0

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?

Poma
  • 1,896

1 Answers1

0

Got it

find . -name "*.php" | sed "s/\.php//" | xargs -i sh -c 'php {}.php > {}.html'
Poma
  • 1,896