home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!psinntp!amexphx!amexphx!mjones
- From: mjones@amex-trs.com ()
- Subject: Insterting a line into a file with ksh
- Message-ID: <1993Jan7.151544.7829@amex-trs.com>
- Sender: usenet@amex-trs.com (Usenet News deamon)
- Reply-To: mjones@amex-trs.com
- Organization: American Express TRS
- Date: Thu, 7 Jan 1993 15:15:44 GMT
- Lines: 23
-
- I would like to take a file such as
-
-
- xxxxx xxxxx xxxxx xxxxxx
- xxxxx xxxxx xxxxx xxxxxx
-
- aaaaa aaaaa aaaaa aaaaaa
- aaaaa aaaaa aaaaa aaaaaa
-
-
- and insert a line such as "zzzz zzzz zzzz zzzz" after the xxxxx line
- but before the aaaaa line.
-
- How can I do this in ksh? The file is too complex to slice it apart
- and reconstitute up with 'grep' and 'cat'. If 'sed' is the answer,
- I don't know what the 'sed' command should look like in this case.
-
- Please repond by e-mail or phone.
-
- Mark Jones
- mjones@amex-trs.com
- mjones@rsv08.cslab-tgsc.amex-trs.com
- (602)492-4176
-