I have some php scrits in a subfolder and want to run some of them (found by a regular expression) via command line.

Here is what I have so far:

find . -name email[^T]*\.php -print0 | xargs -0 -t -r /usr/local/bin/php

unfortunately only the first php script is executed.

Is there a way to tell xargs to execute the /usr/local/bin/php command on a per file basis?

Regards

Jeremy

link|improve this question
feedback

1 Answer

up vote 2 down vote accepted

You need to tell xargs to only pass a single argument to the command by using -n 1.

Or you could just use -exec ... \; in find.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.