![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| overwrite specific lines in a file | csecnarf | Shell Programming and Scripting | 7 | 05-13-2008 08:01 AM |
| how to remove specific lines from a file | bluemoon1 | Shell Programming and Scripting | 17 | 10-07-2007 07:40 PM |
| replacing first line or lines in a file | Terrible | UNIX for Advanced & Expert Users | 3 | 06-28-2006 05:23 PM |
| Update specific lines in a file | aukequist | Shell Programming and Scripting | 3 | 11-15-2005 09:52 AM |
| How do you specific lines in a file? | hedgehog001 | UNIX for Dummies Questions & Answers | 2 | 08-22-2005 09:04 PM |
|
|
Submit Tools | LinkBack | Thread Tools | 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 |
| Forum Sponsor | ||
|
|
|
|||
|
You might try something like this if you don't want to create a file:
Code:
echo '%s/oldtext/newtext/g\nwq' | ex file |
|||
| Google The UNIX and Linux Forums |