[NTLUG:Discuss] A quick Bash scripting question

David Stanaway david at stanaway.net
Wed May 8 00:25:38 CDT 2002


For an all bourne approach (This is what I would do).

for f in *.xpm; do mv "${f}" "${f%.xpm}_32x32.xpm"; done

 

On Wed, 2002-05-08 at 00:10, Courtney Grimland wrote:
> Thanks!  I've now added 'basename' to my mental toolbox.
> 
> 
> > #!/bin/bash
> > 
> > for file in *.xpm; do
> >  mv $file `basename $file .xpm`_32x32.xpm
> > done
> > 
> > HTH.
> > 
> > Ry
> > -- 
> > > chemwonk <chemwonk> wrote:
> > >ObMessy: Explaining the hotel charge for "12 year old virgin" to the
> > >accountants at the home office.
> >  
> >  Bill it as "laptop maintenance".
> > - Tina Marie
> 
> _______________________________________________
> http://www.ntlug.org/mailman/listinfo/discuss
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 524 bytes
Desc: This is a digitally signed message part
Url : http://ntlug.org/pipermail/discuss/attachments/20020508/e7fd15e0/attachment.bin


More information about the Discuss mailing list