Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 May 2006 17:56:16 +0200
From:      "No@SPAM@mgEDV.net" <nospam@mgedv.net>
To:        "'Giorgos Keramidas'" <keramida@ceid.upatras.gr>
Cc:        freebsd-questions@freebsd.org
Subject:   RE: Trimming Whitespace From Beginning and end of Text Lines
Message-ID:  <000d01c675dc$9a36dee0$01010101@avalon.lan>
In-Reply-To: <4464A94C.6020606@mac.com>

next in thread | previous in thread | raw e-mail | index | archive | help
 
> > 	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'

usage examples:
-> cat file| sed ... >file1
-> echo $variable| sed ... |grep xy
-> if [ "`echo $xy|sed ...`" = "blabla bla" ]; then ...

cu...




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000d01c675dc$9a36dee0$01010101>