The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 09-29-2006
hcclnoodles hcclnoodles is offline
Registered User
  
 

Join Date: Mar 2002
Posts: 272
replacing specific lines in a file

Hi there
I have a file which has the lines



Code:
# Serial number for hostid
EXP_SERIAL_=""

These lines could be anywhere in the file as far as line numbers go, I would like replace these two lines with


Code:
# Serial number for hostid $var1
EXP_SERIAL_$var1="$var2"

Is there a quick and simple way for me to do this ?

cheers