diff options
Diffstat (limited to 'replace.sh')
-rwxr-xr-x | replace.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/replace.sh b/replace.sh new file mode 100755 index 0000000..5bde2bd --- /dev/null +++ b/replace.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +if [ -z $1 ] ; then + echo missing argument: file to read + exit 1 +fi + +file="$1" + +sedargs="" +for var in \ + BINDIR \ + OPENRC_RUN \ + ; do + sedargs="${sedargs} -e s:\@${var}\@:${!var}:g " +done + +cat "$file" | sed ${sedargs} |