[lug] simple script

Ken Weinert kenw at ihs.com
Mon Oct 8 21:29:47 MDT 2001


* Taz (feenix at ticnet.com) [011009 03:18]:
> Hi all:
> Here an easy one.  I have a small script I use to convert files from
> .bmp to .jpg  It works just great except for one small thing.  The
> filenames starts out as:
> 
> whatever.bmp
> 
> then after conversion is
> 
> whatever.bmp.jpg
> 
> instead of  whatever.jpg
> 
> How do I make the filename simply "whatever.jpg"  Here is the script:
> 
> for i in *.bmp
>         do
>         echo "converting " $i " to .jpg format"
>         convert $i $i.jpg

	convert $i ${i%%.bmp}.jpg

> done

-- 
Ken Weinert   kenw at ihs.com 303-858-6956 (V) 303-705-4258 (F)
GnuPG KeyID: 9274F1CE           GnuPG available at http://www.gnupg.org/
GnuPG Key Fingerprint: 1D87 3720 BB77 4489 A928  79D6 F8EC DD76 9274 F1CE
The major difference between a thing that might go wrong and a thing that
cannot possibly go wrong is that when a thing that cannot possibly go wrong
goes wrong it usually turns out to be impossible to get at or repair.
                   from _Mostly Harmless_ by Douglas Adams

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 240 bytes
Desc: not available
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20011008/700fa70e/attachment.pgp>


More information about the LUG mailing list