[ale] need a simple script

Ken Nagorski kenn at refriedgeek.com
Wed Jan 23 08:59:31 EST 2002


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.






More information about the Ale mailing list