![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| insert multiple lines into a file | c0mrade | Shell Programming and Scripting | 12 | 09-04-2008 04:04 PM |
| put the contents of this file into a variable with multiple lines | Nomaad | Shell Programming and Scripting | 3 | 04-23-2008 12:39 AM |
| retrieved multiple lines on multiple places in a file | dala | Shell Programming and Scripting | 8 | 03-14-2008 03:28 PM |
| How to copy multiple lines from a file to another using AWK? | jisha | Shell Programming and Scripting | 3 | 01-08-2008 01:04 AM |
| Need to delete multiple lines in a file. | kangdom | Shell Programming and Scripting | 6 | 10-16-2006 11:02 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Add Multiple Lines in an existing file
Hi Unix Experts,
I like to add the following multiple lines in an existing file: CHANNELS: MaxChannels=600 MaxActiveChannels=600 MaxInitiators=22 I would be highly appreciated if somebody can shed some light on it. Thank you in advance!!! Khan |
|
||||
|
Quote:
I hope you understand my question. Thank you for all who can shed some light!!! Khan |
|
||||
|
Quote:
Anyway, to add those lines to files, you can use cat and the >> cat existing_file >> some_file provided your existing_file contains only the lines you want to add. |
|
||||
|
If you want to add those lines in any part of file then u can do that by using SED
"sedscript" file ############ /pattern/a\ CHANNELS:\ MaxChannels=600\ MaxActiveChannels=600\ MaxInitiators=22 ############ sed -f sedscript ipfile If you want to insert after for example 10th line then use 10a\ If you want to insert before that pattern or some line then use 10i\ |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|