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'm trying to generate static html files for all php scripts inside dir:

find . -name "*.php" -exec php {} > {}.html \;

But it just dumps all results to {}.html. How to do it properly? And how to remove '.php' from filenames?

share|improve this question
    
Please do not cross post between different sites. –  Uwe Plonus Jun 5 '13 at 12:06
    

1 Answer 1

Got it

find . -name "*.php" | sed "s/\.php//" | xargs -i sh -c 'php {}.php > {}.html'
share|improve this answer

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.