Monday, May 9, 2011

Shell script for multiple SED edits

Following shell script
1.    Reads the names of the files to be edited from the file "filelist".
2.    Executes two sed statements on each of those files and
3.    Overwrites the original file. 


#!/usr/bin
while read line
do
sed 's/0512/0505/g' $line > temp
sed 's/05\/13/05\/06/g' temp > $line
done < filelist 

No comments:

Post a Comment