to remove comments (start with # and /* comment */) in settings.php, below command is just works fine:
sed '/^\#/d' settings.php > outp.txt
mv outp.txt settings.php
sed '/\/\*/,/*\//d; /^\/\//d; /^$/d;' settings.php > outp2.txt
mv outp2.txt settings.php
sed '/^$/d' settings.php > outp3.txt
mv outp3.txt settings.php
But how to remove comments in all files including in subdirectories?
sed -ito do an in-place edit. Also, you are doing/^$/dtwice. – u1686_grawity Mar 20 '11 at 08:15sed. I will look into it – Juragan Kaskus Ngecrot Mar 20 '11 at 08:22