Andrew Libby on 24 Nov 2005 19:25:54 -0000

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] bash script help

I'm not sure why it stopped working, but you might
try a version something like this:


for file in $*; do
    echo mv -v $file $prepend$file

It makes sense to me that it'd only work on one file, because
there's only ever a single file in $2 to process. 

As others have indicated, there's rename.


Art Alexion wrote:

>I have a script that used to work called prepend.filename.  It consists of
>for file in ${2}
>mv -v $file ${1}$file
>I used to be able to run it like this
>prepend.filename Chipmunks- *.mp3
>and it would prepend Chipmunks- to every mp3 file in the current working
>directory.  Now strangely, it works on one file, then exits.  Run it
>again and it works on the next file and exits again.  What went wrong?
>Philadelphia Linux Users Group         --
>Announcements -
>General Discussion  --

Philadelphia Linux Users Group         --
Announcements -
General Discussion  --