PATH=/some/path
export PATH
My original sed command looked like this:
sed -i "s/findThis/$PATH/g" someFile.cfg
Execution of the script kept throwing the following exception:
sed: -e expression #1, char 33: unknown option to `s'
After some trial and error, I discovered that the issue was related to the file separators (/) in the value of PATH. Instead of using a '/' as the separator for sed, use a pipe '|'.
sed -i "s|findThis|$PATH|g" someFile.cfg
No comments:
Post a Comment