Results 1 to 2 of 2
I am using this command:
Code:
sed -i 's?,\$HTTP_USER_AGENT,?,$HTTP_USER_AGENT."\nFile: ".__FILE__."\nLine: ".__LINE__,?g' *.php
to modify a line in my php files. I want to do this recursively from the directory I ...
- 05-09-2010 #1Just Joined!
- Join Date
- Apr 2003
- Posts
- 52
problem using sed
I am using this command:
to modify a line in my php files. I want to do this recursively from the directory I am in. but I get this message in response:Code:sed -i 's?,\$HTTP_USER_AGENT,?,$HTTP_USER_AGENT."\\nFile: ".__FILE__."\\nLine: ".__LINE__,?g' *.php
sed: can't read *.php: No such file or directory
sed version is 4.1.2
It's important that I only change *.php files, and do so recursively. Can anyone help? Thank you!
- 05-09-2010 #2
I think you can't put wildcards in filenames for this operation.
This may be a solution:
Code:for i in `ls *php` ; do sed $options $i done
Can't tell an OS by it's GUI


Reply With Quote