[PLUG] A shell scripting lesson

Sandy Herring sandy at herring.org
Mon Jun 10 20:01:01 UTC 2002


On Mon, 10 Jun 2002, Richard Steffens wrote: 
> Rich Shepard wrote:
> 
> >   I don't want to blow away files or spend the rest of today working it all
> > out, so I'm asking.
> 
> Russell Senior wrote:
> 
> > And, in case you aren't total clear on how the replacement works, try
> > with "echo" replacing the "mv" first:
> > 
> >   for f in 0606* ; do echo $f 0605_${f#0606_} ; done
> 
> Russell's approach is more elegant, and in the long run probably more
> useful. When I am faced with doing something hazardous, I usually create
> a copy in a separate directory somewhere and test the action on the
> copy.
> 
> -- 
> Regards,
> 
> Dick Steffens
> "Quando Omni Flunkus Moritati"
> http://rsteff.home.attbi.com/

The rename.pl script I referenced has a `-p' switch for that purpose.

Sandy
-- 
Sandy Herring, RHCE                        o              sandy at herring.org
Peck of Pickled Pisces               __  o               http://herring.org/
UNIX or Web authoring questions?  |\/ o\  o  http://herring.org/finger.html
=>http://herring.org/techie.html  |/\__/     http://herring.org/pub-key.asc
*sh, Perl, C, VBA, PICK Assembler, Data/Basic, PROC & profanity spoken here.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
URL: <http://lists.pdxlinux.org/pipermail/plug/attachments/20020610/99e88bce/attachment.asc>


More information about the PLUG mailing list