bug-grep
[Top][All Lists]
Advanced

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

bug#18377: piping output through egrep -- escaping of "+" only needed so


From: Norihiro Tanaka
Subject: bug#18377: piping output through egrep -- escaping of "+" only needed sometimes. Why?
Date: Mon, 01 Sep 2014 20:44:35 +0900

"egrep 'libstdc++'" is taken as "egrep 'libstd(c+)+'", although I don't
see that this behaviour is clearly defined in POSIX.  Therefore, as Paul
says, it's synonymous with 'libstdc(c*)'.


On Sun, 31 Aug 2014 19:07:48 -0700
address@hidden wrote:

> Hi all,
> 
> I'm trying to pipe of output of a command through egrep.
> 
> If I do this
> 
>       ldconfig -p | egrep "libstdc++"
>               libstdc++.so.6 (libc6,x86-64) => /usr/lib64/libstdc++.so.6
>               libstdc++.so.6 (libc6) => /usr/lib/libstdc++.so.6
> 
> that *IS* the answer I expect.
> 
> But if I simply add a ".so" to the egrep target, it returns nothing
> 
>       ldconfig -p | egrep "libstdc++.so"
>               (empty)
> 
> If I *escape* the two "+", it works again.
> 
>       ldconfig -p | egrep "libstdc\+\+.so"
>               libstdc++.so.6 (libc6,x86-64) => /usr/lib64/libstdc++.so.6
>               libstdc++.so.6 (libc6) => /usr/lib/libstdc++.so.6
> 
> Why do I need to escape the "+" in the last case, but not in the first?
> 
> Terry
> 
> 






reply via email to

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