Sed error with directory

bash, directory, linux, replace, sed

Solution

Since `$CUSTOM_INSTALL_HOME` has forward slash `/` you can use a different delimiter like hash `#` in sed:

sed -i "s#location_apache#$CUSTOM_INSTALL_HOME#g" $apache_boing

Problem

I'm trying to use sed to replace some directories over a file. This is how I'm using the sed to replace. `sed -i "s/location_apache/$CUSTOM_INSTALL_HOME/g" $apache_boing` Now, the problem comes with the `$CUSTOM_INSTALL_HOME` variable. Because is a directory. Every time I tried to run the script I got this error. sed: -e expression #1, char 22: unknown option to `s' I know this is because the missing \ on the `$CUSTOM_INSTALL_HOME` variable There is any workaround for this issue? Thanks

Original source