[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
grep
From: |
W. B. Maguire II |
Subject: |
grep |
Date: |
Tue, 7 Dec 2004 14:44:26 -0700 |
User-agent: |
Mutt/1.5.6i |
Hello:
First of all, *thanks* for all the great GNU software!
Unexpected behavior using 'grep' with the '-f' and '-P' options:
[Steps to recreate:]
--------------------
1) Create a file to search:
$ cat > target.txt
a
b
c
d
e
f
g
h
i
gnu is great
x
y
z
^D
2) Create a file containing the patterns for which to search:
$ cat > patterns.txt
a
g
y
^D
3) Grep with *NO* "--perl-regexp" works as expected:
$ GREP_OPTIONS="" grep -f patterns.txt target.txt
a
g
gnu is great
y
4) Grep *WITH* "--perl-regexp" _does_not_work_:
$ GREP_OPTIONS="" grep -P -f patterns.txt target.txt
[exits with a value of "1"]
5) And *I* found it because grep was failing with my
"$GREP_OPTIONS" environment variable setting:
$ GREP_OPTIONS="--perl-regexp" grep -f patterns.txt target.txt
[exits with a value of "1"]
I didn't see this behavior mentioned anywhere; I hope I'm not
doing anything dumb, but I can't see it, if so... Could you
please respond either way, so that I know that this was read?
Thanks!
Bruce.
--
_________ address@hidden ________ |**===
/ |**===
( W. B. Maguire II, Ph.D. Tel: 303.772.1615 |=====
| Chief Executive Manager FAX: 303.651.6389 9||
| Analytic Investments LLC _ |
| 700 Ken Pratt Blvd STE204 PMB166 ( ) The ASCII ribbon |
( Longmont CO 80501-6455 X campaign against )
\__________________________________ / \ _ HTML e-mail __/
- grep,
W. B. Maguire II <=