[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: bash/sed script help needed



>I have ten files in a directory I am trying to convert from *.eps to *.jpg.

>file1.eps
>file2.eps
>file3.eps

>for a in *.eps;do t=`sed 's/*.eps/*.jpg/'`;convert $a $t;done

>But this doesn't rename the file to file1.jpg

sed stands for "stream editor" -- it works on an input strem line by line,
executing functions (in this case the substitute function). 

here's how i'd do what you want to do, and it has the advantage it will
descend through directories because it uses paths.
find ./ -name '*.eps' | sed -e 's/\.eps//' | xargs -t -i/{} convert /{}.eps
/{}.jpg 

-i
ianw@ieee.org
http://www.wienand.org
**********************************************************************
CAUTION: This message may contain confidential information intended only for the use of the addressee named above. If you are not the intended recipient of this message, any use or disclosure of this message is prohibited.  If you received this message in error please notify Mail Administrators immediately.  You must obtain all necessary intellectual property clearances before doing anything other than displaying this message on your monitor.  There is no intellectual property licence.  Any views expressed in this message are those of the individual sender and may not necessarily reflect the views of Woolworths Ltd.
**********************************************************************


-- 
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: