bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SED


From: Bob Proulx
Subject: Re: SED
Date: Sat, 14 Dec 2002 17:06:16 -0700
User-agent: Mutt/1.4i

CRISTESCU Florin Radu <address@hidden> [2002-12-14 08:54:04 +0200]:
> 
> > I tryed the following SED command and failed: 's/^ +//'. Is this a bug or 
> > am I just stupid?
> 
> It looks like I'm stupid alright :) I should have used 's/^[ ]\{1,\}//' 
> for things to work the way I want them to do :)

I would have said that the good ol' method for doing that in sed is
with 's/^  *//'.  Litterally space-space-star.  The first space stands
on its own, the second has the star modifier which means zero or more.

Since sed has traditionally implemented the basic regular expressions
instead of the extended regular expressions this works everywhere.
Your extended regular expression example works only with GNU sed which
implements the extended expressions.

Bob



reply via email to

[Prev in Thread] Current Thread [Next in Thread]