| Summary: | grep -P looks broken wrt pipes | ||
|---|---|---|---|
| Product: | Sisyphus | Reporter: | at <at> |
| Component: | grep | Assignee: | placeholder <placeholder> |
| Status: | CLOSED FIXED | QA Contact: | qa-sisyphus |
| Severity: | normal | ||
| Priority: | P2 | CC: | evg, glebfm, ldv, php-coder, placeholder, vt |
| Version: | unstable | ||
| Hardware: | all | ||
| OS: | Linux | ||
grep -P is also utterly broken, besides of -o option:
$ for i in `seq 1 999`; do rpm -qa --qf '[%{PROVIDES}\n]' |grep -P
'^lib[^/()]+\.so' |grep -vc ^lib; done |sort |uniq -c |sort -n
3 2
62 3
934 1
Thats is, looks like grep -P returns semi-random wrong results.
Something odd happens with pipes: replacing
rpmquery -a --qf '[%{PROVIDES}\n]'
with
cat file
makes grep -Po happy.
In grep-2.6.3-alt1 the bug is already fixed. |
$ rpm -qa --qf '[%{PROVIDES}\n]' |grep -Po '^lib[^/()]+[.]so\b[^/()]*' outputs lines that match the soname pattern as well as lines that do not match the pattern; and even empty lines which are not in the input. http://lists.altlinux.org/pipermail/devel/2007-January/041110.html