global regular expression substitute
Many thanks to grep for the inspiration.
A simple shellscript to replace patterns in textfiles. It is not groundbreaking or anything, but it sped things up for me in the *nix world.
(note: this just makes a sed command a little more usefull, and as such, only writes to standard output.
Remember to redirect output.)
if [ $# -ne 3 ]
echo "BZZZT! Usage: old-pattern new-pattern filename.
Dont forget: sed wont redirect output unless you tell it to"
if [ -f $3 ]
echo " file \"$3\" does not exist, please try again."
#do the work
sed -e "s/$1/$2/" $file_name