bug-grep
[Top][All Lists]
Advanced

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

possible bug, not sure GNU grep 2.6.3


From: Mike Hahn
Subject: possible bug, not sure GNU grep 2.6.3
Date: Mon, 23 Apr 2012 14:01:27 -0400
User-agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120327 Thunderbird/11.0.1

   Hi,
     I got a very unexpected result while using grep.  I have 3 files with
   IP and dns pairings.  file 1, 2 and 3.  If I use "grep [[:alpha:]] 1" I
   get the expected results, all the IP addresses with their host name.
   However, if I use "grep [[:digit:]] 1" I get all IP's from all 3
   files.  I actually found this by using the -c to count the number of IP
   addresses.  Much to my surprise I got the results of all 3 files.
   File content.
   file 1:
   ----------------------------------------
   10.0.0.101        usera
   10.0.0.102
   10.0.0.103        userb
   10.0.0.105
   10.0.0.106
   10.0.0.110
   10.0.0.111        userc
   10.0.0.112        userd
   10.0.0.113        usere
   ----------------------------------------
   file 2:
   ----------------------------------------
   10.0.0.101        usera
   10.0.0.102
   10.0.0.103        userb
   10.0.0.105
   10.0.0.106
   10.0.0.110
   10.0.0.111        userc
   10.0.0.112        userd
   10.0.0.113        usere
   ----------------------------------------
   file 3:
   ----------------------------------------
   10.0.1.102
   10.0.1.103        usera
   10.0.1.106
   10.0.1.107        userb
   10.0.1.109        userc
   10.0.1.114
   10.0.1.115
   10.0.1.118        userd
   10.0.1.120        usere
   ----------------------------------------
   Command usage and output:
   user:user>grep -c [[:alpha:]] 1
   5
   user:user>grep -c [[:digit:]] 1
   2:9
   3:9
   1:9
   Regards,

   --

   Mike Hahn
   Flex-N-Gate Michigan, LLC.
   Voice: 586.439.4026
     Fax: 586.773.0054
    Cell: 586.709.2385
   address@hidden

References

   1. mailto:address@hidden


reply via email to

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