sed - REG-exp negating at end of line -
i have ending lines like
"true"/> testname="a01 "true"> prop> testname="a02
wanted insert text @ end of lines containing testname="a0...
i tried below option
sed -i 's/!>$/_\" enabled=\"true\">/g' file sed -i 's/!>\\n/_\" enabled=\"true\">/g' file
however not reflecting in file. tweak needed this. me out on this
you can use awk
awk '/="a0[0-9]+$/ {$0=$0" blabla"}1' file "true"/> testname="a01 blabla "true"> prop> testname="a02 blabla
to update original file:
awk '/="a0[0-9]+$/ {$0=$0" blabla"}1' file > tmp && mv tmp file
Comments
Post a Comment