4 if [ "$#" = "2" ]; then
5 echo "usage: substitute.sh <variable to replace> <value to replace with> <filename | STDIN>"
9 if [ "$#" = "3" ]; then
14 echo "replacing $VARIABLE with $VALUE in $FILENAME"
15 sed -e "s/$VARIABLE/$VALUE/" $FILENAME > "$FILENAME"_tmp
16 mv "$FILENAME"_tmp
$FILENAME
20 if [ "$#" = "2" ]; then
27 echo "replacing $VARIABLE with $VALUE in $FILENAME"
28 sed -e "s/$VARIABLE/$VALUE/" $FILENAME > "$FILENAME"_tmp
29 mv "$FILENAME"_tmp
$FILENAME