I\'m trying to find and replace a string in a folder of files.
Could someone possibly help me?
My script is as follows:
#!/bin/bash
OLD=\"Thi
Check this out
http://cs.boisestate.edu/~amit/teaching/handouts/cs-unix/node130.html
##########################################################
\#!/bin/sh
\# sed/changeword
prog=`basename $0`
case $# in
0|1) echo 'Usage:' $prog ' '; exit 1;;
esac
old=$1
new=$2
for f in *
do
if test "$f" != "$prog"
then
if test -f "$f"
then
sed "s/$old/$new/g" $f > $f.new
mv $f $f.orig
mv $f.new $f
echo $f done
fi
fi
done
##############################################################