unix command to remove white spaces

view full story

http://www.linuxquestions.org – Hello, Im using this unix command(in a php file) to remove a certain string and then remove the whitespace left by that string. Unofrtunately in many cases, the files get completely erased. Is there a workaround? Code: <?php    $dir = "./";    $rmcode = `find $dir -name "*.php"  -type f |xargs sed -i 'somestring' 2>&1`; echo "String removed.<br />\n";  $emptyline = `find $dir -name "*.php"  -type f | xargs sed -i '/./,$!d' 2>&1`; echo "Empty lines removed.<br  />\n"; (HowTos)