Strict Subs??

Mike Reinehr cmr
Thu Nov 9 12:56:48 PST 2006


Bruce,

On Thursday 09 November 2006 14:24, Bruce Marshall wrote:
> On Thursday 09 November 2006 14:38, Matthew Carpenter wrote:
> > > Doing some googling, all I can find on this is an error message that
> > > perl will put out. ?Yet as far as I know, there shouldn't be any perl
> > > involved here.
> >
> > More info please? ?What is the simple script? ?If you see "Bareword"
> > and "strict subs" together in a sentence, you are likely running some
> > perl... perhaps where you shouldn't be? :) ?How is the script invoked?
> > ?Does it specify the interpretter as #!/bin/??? on the first line?
>
> Here's the first few lines:  This is script to run digikam where some
> pictures might be uploaded.  This then will do a rename on some of the new
> files to keep out caps etc.....
>
> #!/bin/sh
> /usr/bin/digikam
> cd /pictures/linpha/albums/bruce/canon/
> echo "---Changing filenames to lower case"
> chmod 666 /pictures/linpha/albums/bruce/canon/*
> rename IMG_ img_ IMG*
> rename .JPG .jpg *.JPG
>
> When run, this does:
>
> 1) runs digikam
> 2) Does the echo  ---Changing filenames to lower case
> 3) Puts out the error message:
>
> Bareword "IMG_" not allowed while "strict subs" in use at (eval 1) line 1.
> syntax error at (eval 1) line 1, near "."
>
>
> No perl that I can see...   I do notice that on suse, /bin/sh -->  bash
> whereas under kubuntu   /bin/sh -->  dash
>
> So they are doing some funny things under the hood but changing the first
> line to be  /bin/bash   doesn't change the error msgs.

You just didn't follow the links far enough. /usr/bin/rename is a link 
pointing to /etc/alternatives/rename, which is a link pointing 
to /usr/bin/prename. /usr/bin/prename is a "perl script text executable". 



More information about the Linux-users mailing list