>>>>> Andreas Berglund <[email protected]> writes:
> I have a problem with the following sed snippet
> sed -i s"|^\( *PATH="\)\(.*\)|\1$ADD:\2|" ~/profile-test
> I need soft quotes in order for $ADD to expand and I also need to
> math against one doublequote in the regexp in for $ADD to be put in
> the corrct place.
The double quote character within Shell's double quotes can be
escaped with a backslash (“\”):
sed -i "s|^\( *PATH=\"\)\(.*\)|\1${ADD}:\2|"
However, one is by no means forced to use just one kind of
quotes in Shell, so the following is also possible:
sed -i 's|^\( *PATH="\)\(.*\)|\1'"${ADD}"':\2|'
> Does anyone know how to do this?
The questions like this are much more likely to be answered by
the comp.unix.shell Usenet newsgroup folks. The newsgroup could
be accessed either using some sort of newsreader software (Gnus,
Alpine, SLRN, Icedove/Thunderbird, etc.), e. g.:
news:comp.unix.shell
nntp://aioe.org/comp.unix.shell/
Or with a Web browser, e. g.:
http://www.webuse.net/frameset.php?ng=comp.unix.shell
http://groups.google.com/group/comp.unix.shell
--
FSF associate member #7257 [np. Cortége — Apocalyptica]
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: http://lists.debian.org/[email protected]