home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / unix / shell / 5300 < prev    next >
Encoding:
Text File  |  1993-01-07  |  924 b   |  35 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!psinntp!amexphx!amexphx!mjones
  3. From: mjones@amex-trs.com ()
  4. Subject: Insterting a line into a file with ksh
  5. Message-ID: <1993Jan7.151544.7829@amex-trs.com>
  6. Sender: usenet@amex-trs.com (Usenet News deamon)
  7. Reply-To: mjones@amex-trs.com
  8. Organization: American Express TRS    
  9. Date: Thu, 7 Jan 1993 15:15:44 GMT
  10. Lines: 23
  11.  
  12. I would like to take a file such as
  13.  
  14.  
  15. xxxxx xxxxx xxxxx xxxxxx
  16. xxxxx xxxxx xxxxx xxxxxx
  17.  
  18. aaaaa aaaaa aaaaa aaaaaa
  19. aaaaa aaaaa aaaaa aaaaaa
  20.  
  21.  
  22. and insert a line such as "zzzz zzzz zzzz zzzz" after the xxxxx line
  23. but before the aaaaa line.
  24.  
  25. How can I do this in ksh?  The file is too complex to slice it apart
  26. and reconstitute up with 'grep' and 'cat'.  If 'sed' is the answer,
  27. I don't know what the 'sed' command should look like in this case.
  28.  
  29. Please repond by e-mail or phone.
  30.  
  31. Mark Jones
  32. mjones@amex-trs.com
  33. mjones@rsv08.cslab-tgsc.amex-trs.com
  34. (602)492-4176
  35.