[prev in list] [next in list] [prev in thread] [next in thread]
List: freebsd-hackers
Subject: Re: Is this a regex bug?
From: "Dave Ng" <chump1 () hushmail ! com>
Date: 2014-01-30 19:12:26
Message-ID: 20140130191227.3BC822035E () smtp ! hushmail ! com
[Download RAW message or body]
Lots of tools you can use -- to signify the end of option parsing
Sent using Hushmail
On January 26, 2014 at 1:33 PM, rank1seeker@gmail.com wrote:> -n is
being interpreted as an option to ‘echo' and being swallowed
before it gets to egrep.
>
> - Mark
I've tried without echo
printf "-nn" | egrep '^-[[:alnum:]]+$'
This works!
Thanks for pointing out.
> Try without the grep:
>
> $ echo '-m'
> -m
> $ echo '-n'
> $ echo '-o'
> -o
> $ man echo
>
>
>
>
> On Jan 26, 2014, at 1:04 PM, rank1seeker@gmail.com wrote:
>
> > Or am I crazy?
> >
> > echo '-m' | egrep '^-[[:alnum:]]+$'
> > echo '-n' | egrep '^-[[:alnum:]]+$'
> > echo '-o' | egrep '^-[[:alnum:]]+$'
> >
> > Guess what?
> > Only middle one, '-n' doesn't match it.
> > Is this an RE bug or I clearly ain't seeing obvious?!
> >
> > echo '-n' | egrep '^-[0-9A-Za-z]+$'
> > Doesn't work either
> >
> > 9.2-RELEASE-p3 i386
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to
"freebsd-hackers-unsubscribe@freebsd.org"
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic