Replace a sentence with another using unix -


i need replace whole line contains <attribute name ="automatically recover terminated tasks" value ="no"/> <attribute name ="automatically recover terminated tasks" value ="yes"/>. sample file below:

    <attribute name ="write backward compatible workflow log file" value ="no"/>     <attribute name ="workflow log file name" value ="wf_hyb01_honeybadger_date_roll.log"/>     <attribute name ="workflow log file directory" value ="$pmworkflowlogdir&#x5c;"/>     <attribute name ="save workflow log by" value ="by runs"/>     <attribute name ="save workflow log these runs" value ="$pmworkflowlogcount"/>     <attribute name ="service name" value =""/>     <attribute name ="service timeout" value ="0"/>     <attribute name ="is service visible" value ="no"/>     <attribute name ="is service protected" value ="no"/>     <attribute name ="fail task after wait time" value ="0"/>     <attribute name ="enable ha recovery" value ="no"/>     <attribute name ="automatically recover terminated tasks" value ="no"/>     <attribute name ="service level name" value ="default"/> 

please help.

you can try single liner sed command this.

sed -i 's/<attribute name ="automatically recover terminated tasks" value ="no"\/>/<attribute name ="automatically recover terminated tasks" value ="yes"\/>/g filename' 

where filename sample file


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -