home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!mcsun!sunic!aun.uninett.no!ugle.unit.no!news
- From: Harald.Eikrem@delab.sintef.no
- Subject: Re: seding with variables and /s question
- In-Reply-To: guenther@StOlaf.edu's message of 13 Sep 92 01:15:19 GMT
- Message-ID: <1992Sep14.155449*Harald.Eikrem@delab.sintef.no>
- Sender: news@ugle.unit.no (NetNews Administrator)
- Organization: SINTEF DELAB, Trondheim, Norway.
- References: <lb4q5tINNaef@jethro.Corp.Sun.COM> <GUENTHER.92Sep12181519@lars.StOlaf.edu>
- Date: 14 Sep 92 15:54:49
- Lines: 17
-
- ! Also, neither csh nor sh do variable substitution within single
- ! quotes, so you would want to enter:
- !
- ! sed -e "s:$DEVEL:$DEST:" $file > $destfile
- !
- ! In fact, as ":" isn't a special character, you needn't do any quoting.
- ! Now if $DEVEL or $DEST contained special characters/whitespace...
-
- Wrong. In csh ':' IS a special character if immediately behind a variable,
- even within quotes.
-
- I personally tend to use control-A characters for sed delimiters within
- shell script files, because control-A is a highly unlikely character to
- appear in a filename, and none of the shells I typically interfere with
- nor sed will mess up a control-A.
-
- ~~harald E.
-