LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

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

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

John Mc Donald johnmcd at cs.may.ie
Thu Mar 16 16:24:09 GMT 2000


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?

Secondly, if I try to use this in a foreach loop in tcsh it does it for
the first file
in the list and then terminates. Can anybody tell me why? I have a fair
idea
that its something to do with enclosing the awk replacing the shell
process
image with itself.

TIA,
John
--
==================================
John Mc Donald,
Dept. of Computer Science,
National University of Ireland,
Maynooth,
Co. Kildare,
Ireland.

Email : johnmcd at cs.may.ie
Phone : +353 -1 - 7084589
Fax : +353 -1 - 7083848
http://www.cs.may.ie/~johnmcd
==================================






More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell