3 # Parameterizes a document.
4 # Input arguments Param1 Value1 Param2 Value2 ... will replace
5 # $Param1$ with Value1, $Param2$ with Value2, and so on.
7 # Arguments with spaces in must be quoted.
11 while [ $# != 0 -a $# != 1 ]; do
12 SUBST=${2//\'/\'\\\'\'};
13 SUBST=${SUBST//\//\\\/};
15 echo -n e \'s/\\\$$1\\\$/$SUBST/g\'\ ;
19 echo -n e \'s/\\\$\%/\$/g\' -e \'s/\\\$\\\$/\$/g\'\ ;
23 if [ "$1" == "-v" ]; then
25 bash --norc -vc "sed `getargs \"$@\"`";
27 bash --norc -c "sed `getargs \"$@\"`";