home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / shell / 3539 < prev    next >
Encoding:
Internet Message Format  |  1992-08-20  |  907 b 

  1. Path: sparky!uunet!wupost!waikato.ac.nz!aukuni.ac.nz!ecmtwhk
  2. Newsgroups: comp.unix.shell
  3. Subject: Re: Sed with shell variables
  4. Message-ID: <1992Aug20.105737.29473@ccu1.aukuni.ac.nz>
  5. From: ecmtwhk@ccu1.aukuni.ac.nz (Thomas Koenig)
  6. Date: Thu, 20 Aug 1992 10:57:37 GMT
  7. References: <2701@nlsun1.oracle.nl>
  8. Organization: University of Auckland, New Zealand.
  9. Lines: 14
  10.  
  11. rgasch@nl.oracle.com (Robert Gasch) writes:
  12.  
  13. >The problem I ran into is that I can't get shell variables to
  14. >work as arguments. When I type
  15. >    echo $something|sed 's/$this_pattern_var/$that_pattern_var/'
  16.  
  17. >sed throws up on me. I've tried various combinations of quotation
  18. >marks without success. Is there an easy way of doing this??
  19.  
  20. echo $something | sed -e s/$this_pattern/$that_pattern/
  21. -- 
  22. Thomas Koenig, ecmtwhk@ccu1.aukuni.ac.nz, ib09@rz.uni-karlsruhe.de
  23. The joy of engineering is to find a straight line on a double logarithmic
  24. diagram.
  25.