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

  1. Path: sparky!uunet!mcsun!sun4nl!orcenl!rgasch
  2. From: rgasch@nl.oracle.com (Robert Gasch)
  3. Newsgroups: comp.unix.shell
  4. Subject: Sed with shell variables
  5. Message-ID: <2701@nlsun1.oracle.nl>
  6. Date: 20 Aug 92 08:04:07 GMT
  7. Organization: Oracle Europe
  8. Lines: 15
  9.  
  10. Using sed to edit strings is usually a nice and practical
  11. method of doing so. I you want to change a pattern you usually
  12. say:
  13.     echo $something|sed 's/pattern1/pattern2/'
  14.  
  15. The problem I ran into is that I can't get shell variables to
  16. work as arguments. When I type
  17.     echo $something|sed 's/$this_pattern_var/$that_pattern_var/'
  18.  
  19. sed throws up on me. I've tried various combinations of quotation
  20. marks without success. Is there an easy way of doing this??
  21.  
  22. Thanks a lot
  23. ---> Rob
  24.  
  25.