[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Sheflug] Easy bash question
On Monday 27 Oct 2003 11:14 am, José Luis Gómez Dans wrote:
> Hi all,
> I have heaps and heaps of files in directories I need to convert
> (they are eps files that need to be converted into Fig's, using
> pstoedit). I have used a simple loop to do this:
> for i in $(ls *.ps); do pstoedit -f xfig <blah> $i > $i.fig ; done
>
> This is fine, but my_file.eps turns out to be my_file.eps.fig,
> which is not aesthetically pleasing (and obviously a source of much
> annoyance :D). So I was wondering, what's the best way of trimming the
> extension from my $i loop variable? Do I have to use sed for this? Do
> I actually need to read the manual?
>
> Thanks,
> José
for i in *.ps;
do
x=`basename $i .ps`
newfile="${x}.fig"
pstoedit -f xfig <blah> $i > $newfile
done
--
Dr. David Holden. (Systems Developer)
Crystallography Journals Online: <http://journals.iucr.org>
Thanks in advance:-
Please avoid sending me Word or PowerPoint attachments.
See: <http://www.fsf.org/philosophy/no-word-attachments.html>
UK Privacy (R.I.P) : http://www.stand.org.uk/commentary.php3
Public GPG key available on request.
-------------------------------------------------------------
___________________________________________________________________
Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html
GNU the choice of a complete generation.