Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
    

Got it

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .