Re: find and replace

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
+ (text/plain)
Delete this message
Reply to this message
Author: Ariel Gold
Date:  
To: Main PLUG discussion list
Subject: Re: find and replace
Here's one way to do it:

for f in *JPG ; do mv $f `basename $f JPG`jpg; done





On Mon, Feb 20, 2012 at 5:54 PM, Michael Havens <> wrote:

> I'm trying to rename some files that have the extension JPG to jpg.
>
> First thing I did was:
>
> bmike1@Michaels-Laptop ~/Pictures/2004 $ mv *JPG *jpg
> mv: target `rosebud1.mod.jpg' is not a directory
>
> huh? i want to move file x to file y! who said anything about a directory?
>
> looked at the man page and tried it with the T option:
>
> bmike1@Michaels-Laptop ~/Pictures/2004 $ mv -T *JPG *jpg
> mv: extra operand `100_0046.JPG'
>
> on the advice of others I tried:
>
> bmike1@Michaels-Laptop ~/Pictures/2004 $ rename JPG jpg *JPG
> Bareword "JPG" not allowed while "strict subs" in use at (eval 1) line 1.
>
> I tried
>
> bmike1@Michaels-Laptop ~/Pictures/2004 $ find *.JPG -exec rename .JPG
> .jpg {} \;
> syntax error at (eval 1) line 1, near "." <95 times>
> bmike1@Michaels-Laptop ~/Pictures/2004 $
>
> and a few others. Why isn't mv moving a file name to another file name?
> --
> :-)~MIKE~(-:
>
> ---------------------------------------------------
> PLUG-discuss mailing list -
> To subscribe, unsubscribe, or to change your mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>

---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss