The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 -->
  #2 (permalink)  
Old 06-17-2008
radoulov's Avatar
radoulov radoulov is offline Forum Staff  
addict
  
 

Join Date: Jan 2007
Location: Варна, България / Milano, Italia
Posts: 2,869
Code:
perl -i.bak -00 -pe's/(TASK sipsiproc.*?ExitAction = )NONE/$1FALSE/s' inputfile
or:

Code:
perl -i.bak -00 -pe's/ExitAction = NONE/ExitAction = FALSE/ if /^TASK sipsiproc/' inputfile

With Awk (nawk or /usr/xpg4/bin/awk on Solaris):

Code:
awk '/^TASK sipsiproc/{sub(/ExitAction = NONE/,"ExitAction = FLASE")}1' ORS="\n\n" RS= inputfile>newfile

Last edited by radoulov; 06-17-2008 at 05:33 AM..