![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| help needed | nnayagam | Shell Programming and Scripting | 2 | 03-07-2008 03:34 AM |
| Little help needed. | Netghost | AIX | 5 | 08-10-2006 11:29 AM |
| Help needed | dsravan | Shell Programming and Scripting | 2 | 07-20-2006 06:37 AM |
| awk help needed. | cskumar | Shell Programming and Scripting | 0 | 07-20-2006 04:24 AM |
| Sed help needed | stevefox | Shell Programming and Scripting | 5 | 12-04-2005 10:44 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Help needed with sed
Hi,
I need to insert a line into a file underneath an existing line in the file, but am unsure as to the syntax. I'm pretty sure sed can be used though, although any ideas are more than welcome. For example: File ---- Line 1 Line 2 Line 3 Line 4 Line 6 I need to say: Insert "Line 5" after "Line 4". Hope this is clear |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Code:
# insert a line so that the new line will be line number 5 sed '5i\ A new line' < $file |
||||
| Google The UNIX and Linux Forums |