Thursday, August 26, 2010

Trim whitespace

The one that worked for me:

echo ' foo bar ' | sed 's/^ *//;s/ *$//'
foo bar

Source: trim whitespace?

No comments: