[ILUG] (Stupid :-( ) filename manipulation question

Donncha O Caoimh donncha.ocaoimh at tradesignals.com
Thu Mar 16 16:31:30 GMT 2000


I'd do

  for i in *.bmp
  do 
  convert $i `basename $i .bmp`.jpg
  done

or something similar, depending on the convert command line.. :)

Donncha.


John Mc Donald wrote:
> 
> This is a stupid question but I'll ask it anyway. I have a couple of
> hundred
> bmp files that I want to convert to Sun Raster format. I figure the best
> thing
> to do this is the convert utility (but I'm open to suggestions). I am
> not a very
> good shell programmer but as far as I can see the way to build the new
> filename from the old would be using something like the line below:
> 
> echo $i | awk 'BEGIN {FS= "."; OFS="."}; {print $1,"jpg"}'
> 
> My first question is am I cracking a nut with a sledge-hammer here?
>




More information about the ILUG mailing list