tiggerific
05-01-2005, 10:34 AM
Hi guys,
I'm being kind of lazy here... I'm not a Perl programmer and don't wish to be (I'm working on PHP at the moment) and I have a one-line command that I can run from SSH that I'd like to be able to run as a Perl script (specifically for my clients that don't have SSH enabled).
Could someone please give me the additional code I would need to make this command line work in an executable Perl script (which does run fine from bash)?
find ./*/*.php -type f -exec sed -i 's/currentip/newip/' {} \;
I've tried various combinations of things including with and without single and double quotes, using different relative path locations, etc. but I'm always getting some type of error. The command simply goes through all PHP files in all subdirectories and replaces "currentip" with "newip".
Hard-coding the currentip and newip is not a problem (i.e. I don't really need variables for them).
Any help will be appreciated.
Thanks
I'm being kind of lazy here... I'm not a Perl programmer and don't wish to be (I'm working on PHP at the moment) and I have a one-line command that I can run from SSH that I'd like to be able to run as a Perl script (specifically for my clients that don't have SSH enabled).
Could someone please give me the additional code I would need to make this command line work in an executable Perl script (which does run fine from bash)?
find ./*/*.php -type f -exec sed -i 's/currentip/newip/' {} \;
I've tried various combinations of things including with and without single and double quotes, using different relative path locations, etc. but I'm always getting some type of error. The command simply goes through all PHP files in all subdirectories and replaces "currentip" with "newip".
Hard-coding the currentip and newip is not a problem (i.e. I don't really need variables for them).
Any help will be appreciated.
Thanks