Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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