[nylug-talk] need sed help
Peter C. Norton
spacey-nylug at lenin.net
Tue Apr 3 14:43:31 EDT 2007
On Tue, Apr 03, 2007 at 01:26:10PM -0400, Eric Moore wrote:
> "Peter C. Norton" <spacey-nylug at lenin.net> writes:
>
> > On Tue, Apr 03, 2007 at 01:19:20PM -0400, Eric Moore wrote:
> >> sed -e '1s/^[ \t]\+//'
> >
> > What are we escaping here? I'm not sure what we're protecting the +
> > from?
>
> It gets interpreted as the literal + unless escaped.
>
> nyarlothotep:~$ echo xxx+++ | sed 's/x+//'
> xx++
> nyarlothotep:~$ echo xxx+++ | sed 's/x\+//'
> +++
>
Ahhh, lovely. That reversal of the usual meaning of "escape" is
wonderful.
-Peter
--
The 5 year plan:
In five years we'll make up another plan.
Or just re-use this one.
More information about the nylug-talk
mailing list