Howdy --
I am doing, a global search and replace in for a entire directory
tree. The command I'm using (which works, but it' not as much fun) is:
find . -name "*.php" -exec sed -i -f script_script
----- script_script ---
s/HTTP_GET_VARS/_GET/g
s/HTTP_POST_VARS/_POST/g
s/HTTP_SERVER_VARS/_SERVER/g
s/HTTP_COOKIE_VARS/_COOKIE/g
s/HTTP_SESSION_VARS/_SESSION/g
------- end of script --
Is there some why I can:
(1) do a recursive search and replace with sed;
(2) use some kind of sed regrex and combine 5 lines into 1.
something like this:
s/HTTP_(GET|POST|SERVER|COOKIE|SESSION)_VARS/_(\2)/g
Were "\2" is GET, POST, etc.
TIA,
David Jackson