bug-grep
[Top][All Lists]
Advanced

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

[bug #35668] odd behaviour with wildcard patterns accidently matching fi


From: Matthias Gorzellik
Subject: [bug #35668] odd behaviour with wildcard patterns accidently matching file names
Date: Wed, 29 Feb 2012 15:43:30 +0000
User-agent: Opera/9.80 (X11; Linux x86_64; U; en) Presto/2.10.229 Version/11.61

URL:
  <http://savannah.gnu.org/bugs/?35668>

                 Summary: odd behaviour with wildcard patterns accidently
matching file names
                 Project: grep
            Submitted by: gotzl
            Submitted on: Wed 29 Feb 2012 03:43:29 PM GMT
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

Scenario: extract numbers out of some text file

         ~ $ echo -e "123\n456" > test
         ~ $ cat test |  grep [0-9][0-9][0-9]
         123
         456
         ~ $ touch 456
         ~ $ cat test |  grep [0-9][0-9][0-9]
         456

It seems that despite I pipe the output of cat to grep, it is getting confused
with a file matching the patter. 
Doing "cat test |  grep -e[0-9][0-9][0-9]" solves the problem,
but I find it kind of unintuitive to see grep failing w/o -e... 




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?35668>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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