home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / question / 10006 < prev    next >
Encoding:
Text File  |  1992-08-12  |  746 b   |  34 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!paladin.american.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!rpi!fitzgb
  3. From: fitzgb@mml0.meche.rpi.edu (Brian Fitzgerald)
  4. Subject: Re: here document in a shell script
  5. Message-ID: <1#-ymnq@rpi.edu>
  6. Nntp-Posting-Host: mml0.meche.rpi.edu
  7. Organization: Rensselaer Polytechnic Institute, Troy, NY
  8. References: <1992Aug11.200320.3202@cbnewsm.cb.att.com> <5z+yk0m@rpi.edu>
  9. Date: Wed, 12 Aug 1992 12:47:15 GMT
  10. Lines: 22
  11.  
  12. I write:
  13. >
  14. >ed - test3 <<!
  15. >g/^/s/ffffcu/xxxxcu/
  16. >g/^/s/8881112222/8881119999/
  17. >w testx
  18. >q
  19. >!
  20.  
  21. By the way, sed can be used:
  22.  
  23. sed 's/ffffcu/xxxxcu/g
  24. s/8881112222/8881119999/' test3 > testx
  25.  
  26. or sed -f sf test3 > testx
  27.  
  28. where sf is
  29.  
  30. s/ffffcu/xxxxcu/g
  31. s/8881112222/8881119999/
  32.  
  33. Brian
  34.