![]() |
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 |
| overwrite specific lines in a file | csecnarf | Shell Programming and Scripting | 7 | 05-13-2008 11:01 AM |
| how to remove specific lines from a file | bluemoon1 | Shell Programming and Scripting | 17 | 10-07-2007 10:40 PM |
| replacing first line or lines in a file | Terrible | UNIX for Advanced & Expert Users | 3 | 06-28-2006 08:23 PM |
| Update specific lines in a file | aukequist | Shell Programming and Scripting | 3 | 11-15-2005 01:52 PM |
| How do you specific lines in a file? | hedgehog001 | UNIX for Dummies Questions & Answers | 2 | 08-23-2005 12:04 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
replacing specific lines in a file
Hi there
I have a file which has the lines Code:
# Serial number for hostid EXP_SERIAL_="" Code:
# Serial number for hostid $var1 EXP_SERIAL_$var1="$var2" cheers |
|
||||
|
You might try something like this if you don't want to create a file:
Code:
echo '%s/oldtext/newtext/g\nwq' | ex file |
| Sponsored Links | ||
|
|