Sunday, March 9, 2008

Remove leading & trailing spaces with sed

Both Leading & Trailing spaces:

sed -e '/^$/d'

Trailing spaces only:

sed 's/[[:blank:]]*$//g'