[oclug] changing file names

Milan Budimirovic milan.budimirovic at sympatico.ca
Mon Mar 25 08:16:56 EST 2002


"Michael P. Soulier" wrote:
> 
> On 24/03/02 b stephen harding did speaketh:
> 
> > So I've never writ my own script before.  will a bash script do the jog or is
> > this a perl, python etc sort of thing.
> 
>     Technically a find command with an exec of a couple of simple shell
> commands should do it.
> 
> [msoulier at tigger msoulier]$ echo "Hi there" | tr '[A-Z]' '[a-z]' | tr " " "_"
> hi_there
> 
>     So, your script could be, say...
> 
> #!/bin/sh
> 
> path=$1

>     Mike

You may want to quote those variables read in as command-line arguments.
That is,

 path="$1"

is much preferable, just in case someone types in a quoted wildcard as
the argument. I point this out only because Bruce is just cutting his
teeth with shell scripts, and he should get into some good habits. :=)



More information about the OCLUG mailing list