bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: bug report in GREP


From: Bauke Jan Douma
Subject: Re: bug report in GREP
Date: Wed, 08 Nov 2006 23:34:53 +0100
User-agent: Thunderbird 1.5.0.8 (X11/20061025)

gagan deep wrote on 08-11-06 13:07:
In First, i did 'll' i.e long listing which show all the file names in the 
current directory.
Next step, search for files of 08th month it show accurate data for this month 
of files and accurate for all other files , but it creates problem when i try 
to search for 06th month in the very last command.

i.e     ls -l | grep "[0-3][0-9][0][6]2006*"

[0-3] and [0-9] - represents day of the month like 08 , 17 [0][6] - represents month and only for this month , grep command gives wrong output address@hidden testin]$ ll
total 0
-rw-rw-r--    1 gagan    gagan           0 Nov  8 17:31 01102006200959.txt
-rw-rw-r--    1 gagan    gagan           0 Nov  8 17:32 02112006200407.txt
-rw-rw-r--    1 gagan    gagan           0 Nov  8 17:32 07102006200242.txt
-rw-rw-r--    1 gagan    gagan           0 Nov  8 17:33 19062005154007.txt
-rw-rw-r--    1 gagan    gagan           0 Nov  8 17:32 19082005154007.txt
-rw-rw-r--    1 gagan    gagan           0 Nov  8 17:32 21092006200959.txt

address@hidden testin]$ ls -l | grep "[0-3][0-9][0][8]2006*"
 -rw-rw-r--    1 gagan    gagan           0 Nov  8 17:32 19082005154007.txt

address@hidden testin]$ ls -l | grep "[0-3][0-9][0][9]2006*"
-rw-rw-r--    1 gagan    gagan           0 Nov  8 17:32 21092006200959.txt

address@hidden testin]$ ls -l | grep "[0-3][0-9][1][0]2006*"
-rw-rw-r--    1 gagan    gagan           0 Nov  8 17:31 01102006200959.txt
-rw-rw-r--    1 gagan    gagan           0 Nov  8 17:32 07102006200242.txt
address@hidden testin]$ ls -l | grep "[0-3][0-9][1][1]2006*"
-rw-rw-r--    1 gagan    gagan           0 Nov  8 17:32 02112006200407.txt

address@hidden testin]$ ls -l | grep "[0-3][0-9][0][6]2006*"
 -rw-rw-r--    1 gagan    gagan           0 Nov  8 17:31 01102006200959.txt
 -rw-rw-r--    1 gagan    gagan           0 Nov  8 17:32 02112006200407.txt
 -rw-rw-r--    1 gagan    gagan           0 Nov  8 17:32 07102006200242.txt
 -rw-rw-r--    1 gagan    gagan           0 Nov  8 17:33 19062005154007.txt
 -rw-rw-r--    1 gagan    gagan           0 Nov  8 17:32 21092006200959.txt


Output looks correct to me.
Try grep --color REGEX.

bjd





reply via email to

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