Trimming Whitespace From Beginning and end of Text Lines

Giorgos Keramidas keramida at ceid.upatras.gr
Fri May 12 09:58:57 PDT 2006


On 2006-05-12 17:56, "No at SPAM@mgEDV.net" <nospam at mgedv.net> wrote:
>>> 	sed -i -e 's/^[[:space:]]*' -e 's/[[:space:]]*$//' file ...
>
> why not use just (you can change the "-" separator to "/" as above):
> sed -e 's-^ *--g' -e 's- *$--g'

Because this provides no additional help with the problem of not
matching TABS and it looks very confusing so close to `-e' and other
command-line options.



More information about the freebsd-questions mailing list