Date: Sun, 26 Jan 2014 22:32:55 +0100 From: rank1seeker@gmail.com To: "Tim Kientzle" <tim@kientzle.com> Cc: hackers@freebsd.org, Mark Blackman <mark@exonetric.com> Subject: Re: Is this a regex bug? Message-ID: <20140126.213255.017.3@DOMY-PC> In-Reply-To: <88CC5471-AD3A-4841-89BB-23D585F77079@kientzle.com> References: <20140126.210430.622.1@DOMY-PC> <88CC5471-AD3A-4841-89BB-23D585F77079@kientzle.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> -n is being interpreted as an option to =91echo=92 and being swallowed = before it gets to egrep.=0D=0A> =0D=0A> - Mark=0D=0A=0D=0A=0D=0AI've = tried without echo=0D=0A=0D=0Aprintf "\-n\n" | egrep = '^\-[[:alnum:]]+$'=0D=0A=0D=0AThis works!=0D=0AThanks for pointing = out.=0D=0A=0D=0A=0D=0A=0D=0A> Try without the grep:=0D=0A> =0D=0A> $ echo = '-m'=0D=0A> -m=0D=0A> $ echo '-n'=0D=0A> $ echo '-o'=0D=0A> -o=0D=0A> $ = man echo=0D=0A> =0D=0A> =0D=0A> =0D=0A> =0D=0A> On Jan 26, 2014, at 1:04 = PM, rank1seeker@gmail.com wrote:=0D=0A> =0D=0A> > Or am I crazy?=0D=0A> > = =0D=0A> > echo '-m' | egrep '^\-[[:alnum:]]+$'=0D=0A> > echo '-n' | egrep = '^\-[[:alnum:]]+$'=0D=0A> > echo '-o' | egrep '^\-[[:alnum:]]+$'=0D=0A> > = =0D=0A> > Guess what?=0D=0A> > Only middle one, '-n' doesn't match = it.=0D=0A> > Is this an RE bug or I clearly ain't seeing obvious?!=0D=0A> = > =0D=0A> > echo '-n' | egrep '^\-[0-9A-Za-z]+$'=0D=0A> > Doesn't work = either=0D=0A> > =0D=0A> > 9.2-RELEASE-p3 i386
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140126.213255.017.3>