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 UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 05-14-2008
upsrk upsrk is offline
Registered User
 

Join Date: May 2008
Posts: 9
Thank You, works perfectly....

Sincere apologies for asking another question but I am very new to scripting and need some HELP.

Question:

How to reverse it.. means find the line with host=atlx3 sid=atld3 and mail=DISABLE and then delete this line and at the same time un-comment ('#') the line above it..

--- INPUT.TXT ------
host=atlx1 sid=atld1 mail=abc@abc.com
host=atlx2 sid=atld2 mail=xyz@abc.com
#host=atlx3 sid=atld3 mail=def@abc.com
host=atlx3 sid=atld3 mail=DISABLE
host=atlx4 sid=atld4 mail=mno@abc.com
-------------------------

---- OUTPUT.txt -----
host=atlx1 sid=atld1 mail=abc@abc.com
host=atlx2 sid=atld2 mail=xyz@abc.com
host=atlx3 sid=atld3 mail=def@abc.com
host=atlx4 sid=atld4 mail=mno@abc.com
--------------------
Reply With Quote