Hello,
I'd like to do something like above, but instead of searching a specific text I'd like to use the variable a. How is the syntax in the second awk line for $a?
I tryed this, but nothing works:
HTML Code:
a=`awk '{if ($1 == "###" && $2 == "END" ) { getline; print } } ' networking`
b="mimi"
awk -v var=$b '{ gsub(/[$a]/,var,$0); print }' networking > bla[/QUOTE]awk -v var=$b '{ gsub(/[$a]/,var,$0); print }' networking > bla
HTML Code:
awk -v var=$b '{ gsub(/$a/,var,$0); print }' networking > bla
HTML Code:
awk -v var=$b '{ gsub($a,var,$0); print }' networking > bla
Or maybe in other words: in the /etc/init.d/networking file I want to write 3 lines below the text "### END INIT INFO".
I should search for the line containing ### END INIT INFO and then write something below this line.
Please help!
edubidu