I'm trying to run a command to remove require_once
from php files from here (code below), but I am getting the error:
sed: can't read -: No such file or directory
I am in the correct folder; what's the problem?
find . -name '*.php' -not -wholename '*/Loader/Autoloader.php' \
-not -wholename '*/Application.php' -print0 | \
xargs -0 sed --regexp-extended --in-place 's/(require_once)/\/\/ \1/g'
Update:
If I run:
find . -name '*.php' -not -wholename '*/Loader/Autoloader.php' \
-not -wholename '*/Application.php' -print0
I get:
find: invalid predicate `-wholename'
I tried this and it returned a list of all the files:
find . -name '*.php' -not -name '*/Loader/Autoloader.php' \
-not -name '*/Application.php' -print0
But then changing the original to reflect this:
find . -name '*.php' -not -name '*/Loader/Autoloader.php' \
-not -name '*/Application.php' -print0 | \ xargs -0 sed --regexp-extended --in-place 's/(require_once)/\/\/ \1/g'
Gives the error:
-bash: xargs: command not found
FYI, I'm running sed version 4.1.2 and I'm a bit a lost in the command line already, so please explain answers
-bash: xargs: command not found
error is because of the backslash immediately beforexargs
. If you remove the backslash or if there's a newline after the backslash, it should work. – Dennis Williamson Nov 11 '10 at 22:31-exec
do it for you? maybe read this question – xenoterracide Nov 12 '10 at 13:58