I have abc.sh
:
exec $ROOT/Subsystem/xyz.sh
On a Unix box, if I print echo $HOME
then I get /HOME/COM/FILE
This may also can help
input="inputtext"
output="outputtext"
sed "s/$input/${output}/" inputfile > outputfile
Say:
sed "s|\$ROOT|${HOME}|" abc.sh
Note:
sed
would expand variables./
since the replacement contains /
$
in the pattern since you don't want to escape it.EDIT: In order to replace all occurrences of $ROOT
, say
sed "s|\$ROOT|${HOME}|g" abc.sh
This might work for you:
sed 's|$ROOT|'"${HOME}"'|g' abc.sh > abc.sh.1