[ale] need a simple script

Mazukna, Thomas Thomas.Mazukna at delta.com
Wed Jan 23 09:08:51 EST 2002


thanks guys,

you beat me...... I had trouble with sed and temp files.
Need to get an espresso to wake up my brain. 

Tomas

-----Original Message-----
From: Ken Nagorski [mailto:kenn at refriedgeek.com]
To: ale at ale.org
Sent: Wednesday, January 23, 2002 9:00 AM
To: ale at ale.org
Subject: Re: [ale] need a simple script


A the precious for loop, 

You can do a few things, lets say that you are using this file to get the
list,

for file in `cat list`
do
 sed s/sting_to_find/string_to_replace_it_with/g <$file >$file.tmp
 mv $file.tmp $file
done

Is there a better way to do this? Probally... Is there 75 other ways? You
bet however that is how I would do it.

Thanks
Ken
 
> Morning scripting gurus,
> 
> need a script that takes in a file which is list of files and does a
> global string replace
> in each file.
> 
> Thanks,
> Tomas
> 
> ---
> This message has been sent through the ALE general discussion list. See
> http://www.ale.org/mailing-lists.shtml for more info. Problems should
> be  sent to listmaster at ale dot org.


----------------------------------------------
But I don't want to go among mad people,
Alice remarked.
Oh, you can't help that, said the Cat:
we're all mad here. I'm mad. You're mad.
How do you know I'm mad? said Alice.
You must be, said the Cat,
or you wouldn't have come here.


---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be

sent to listmaster at ale dot org.

---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list