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
Post a Comment