david wrote:

$ for i in *.tif ; convert $i $i.jpg; done
$ for i in $i.jpg ; do mv $i `echo $i | sed s/.tif//`; done

Apart from specific examples, where do I look in the bash book for a better
way to remove the <.tif> part of the output filename, or other such
substitutions?

OTTOMH, there are some interpolation constructs in bash to help with this:

${VARIABLE#string}
${VARIABLE##string}

${VARIABLE%string}
${VARIABLE%%string}

and saving "substitute" (best) for last:

${VARIABLE/from/to}

in your case perhaps: mv $i ${i/.tif/}

All of the above are described somewhere in the 4000+ pages
of the bash manual ;)

cheers
rickw







--
_________________________________
Rick Welykochy || Praxis Services

I was born in 1992. You have been negotiating all my life.
You cannot tell us that you need more time.
     -- Christina, 17, Solomon Islands - threatened by sea level rise
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to