Sed example 2
Monday, June 25th, 2007Replacing whitespace, lifted directly from the handy collection of sed one-liners at Sourceforge:
Delete all leading whitespace from line (tabs and spaces):
sed ’s/^[ \t]*//’
Delete whitespace at end of line:
sed ’s/[ \t]*$//’
Delete leading and trailing whitespace:
sed ’s/^[ \t]*//;s/[ \t]*$//’