unix - Find and insert text -


i trying find occurrences of header("") in php project , looking add error_log("header changed here") or message can find out header changing. on script.

13:06:38 [uu@dhcp-34] cat test.txt header()  13:06:41 [uu@dhcp-34] cat a.bash #!/bin/bash  sed -e '/header()/a \ error_log(\"header changed here\")' test.txt  13:06:49 [uu@dhcp-34] ./a.bash header() error_log("header changed here")  13:06:58 [uu@dhcp-34]  

make sure have sed in 2 lines way have above, not in single line.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -