gsub
pdirt/drv/compiler/scripts/gsub · 357 B
From the archive pDirt-1_tar.gz
Download the archive « Back to the archive contents
# !/bin/sh
# Do global replacement of string in all source code files.
# I use this all the time, but I advise you to be careful
# -Fusion
if [ $# = 0 ] ; then
echo 'Global replacement for the area files.'
echo 'Usage: gsub <searchpat> <replacement>'
exit 1
fi
for file in *.area
do
sed -e "s/$1/$2/g" $file > ${file}.temp
mv ${file}.temp $file
done