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\"/> <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
Post a Comment