[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] Rename Mult Files
- Subject: Re: [cobalt-users] Rename Mult Files
- From: Greg Hewitt-Long <cobaltusers@xxxxxxxxxxxxxxxxxxx>
- Date: Mon Feb 16 15:49:01 2004
- List-id: Mailing list for users to share thoughts on Sun Cobalt products. <cobalt-users.list.cobalt.com>
At 03:19 PM 2/16/2004, you wrote:
Hi,
Hope all is well with everyone...
How do you rename mult files in the same directory?
I have a dir with about 400 filename.jpg in it...most of them have incorrect
file names such as filename.jpg.jpg
I try mv filename.jpg.jpg to filename.jpg and it works fine...
I try mv *.jpg.jpg to *.jpg
But it says I need to use a directory...Is there a way that I can change
mult file in the same directory?
for FILE in `ls -1 *.jpg.jpg`
do
NEWFILE="`echo $FILE | sed 's/.jpg.jpg/.jpg/'`"
mv $FILE $NEWFILE
done
Watch your quotes!
to be safer:
mkdir SAFE
for FILE in `ls -1 *.jpg.jpg`
do
NEWFILE="`echo $FILE | sed 's/.jpg.jpg/.jpg/'`"
cp $FILE SAFE/
mv $FILE $NEWFILE
done
Thanks in advance
Regards,
Mitch
MissWebhost.com
_____________________________________
cobalt-users mailing list
cobalt-users@xxxxxxxxxxxxxxx
To subscribe/unsubscribe, or to SEARCH THE ARCHIVES, go to:
http://list.cobalt.com/mailman/listinfo/cobalt-users