[ale] need a simple script

Byron A Jeff byron at cc.gatech.edu
Wed Jan 23 08:57:55 EST 2002


> 
> 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.

---
#!/bin/bash
#
# Lightly tested shell script. No error checking
# Usage: sub <file> <from> <to>

while read file ; do
   sed -e "s/$2/$3/g" < $file > /tmp/$$
   mv /tmp/$$ $file
done < $1
--

My bill's in the mail ;-)

BAJ

---
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