home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / shell / 3940 < prev    next >
Encoding:
Text File  |  1992-09-14  |  1.2 KB  |  30 lines

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