fixyourserver.com

A lot of stuff and things…

Remove Whitespace From Files Using Sed

Recently, I encountered a problem where numrous whitespaces were added in and around php so to fix this:

#!/bin/sh
files="/path/to/files/*.php"
for i in $files
do
  sed '/^$/d' $i > $i.out
  mv  $i.out $i
done

Next Post

Previous Post

Leave a Reply

© 2017 fixyourserver.com

Theme by Anders Norén