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