0
I am using AIX
, and there is not an -i
option available in the version of sed
I am using:
sed: illegal option -- i
Usage: sed [-n] Script [File ...]
sed [-n] [-e Script] ... [-f Script_file] ... [File ...]
I want to replace the path of the directory in one of the file using a script; I am trying like this:
WORKDIR="/workdir/liv/spool"
ARCHIVE="u/user/new"
sed 's/$WORKDIR/$ARCHIVE/ig' test.dat > abc
mv abc test.dat
which gives the error:
sed: Function s/$WORKDIR/$STRATIXARCHIVE/ig cannot be parsed.
I would like to replace all occurrences same as $WORKDIR with $$ARCHIVE
It won't, because there are slashes in the variable contents: use different delimiters for the
s
command:sed "s:$WORKDIR:$ARCHIVE:ig" test.dat > abc
– glenn jackman – 2015-07-08T10:51:28.120Works fine # delimiter worked for me.thanks man – Grv – 2015-07-09T09:14:21.273