Re: [ILUG] grep problems

From: Gavin McCullagh (ilug_gmc at domain fiachra.ucd.ie)
Date: Fri 27 Sep 2002 - 15:35:02 IST


On Fri, 27 Sep 2002, Padraig Brady wrote:

> Can anyone explain the following
> (there should be no output from any of the greps below).
>
> [pixelbeat ~]$ file_ids="1025:243:file1\n243:1025:file2\n243:243:file3\n"

so:
        gavin at domain mahler gavin> echo -ne $file_ids
        1025:243:file1
        243:1025:file2
        243:243:file3

> [pixelbeat ~]$ echo -ne $file_ids | grep -E "(0|1|1025|0):(0|1|1025|0)"
> [pixelbeat ~]$ echo -ne $file_ids | grep -E "(0|1|2|1025|0):(0|1|2|1025|0)"
> 1025:243:file1

it matches '1025:2' here as far as I can see.

> [pixelbeat ~]$ echo -ne $file_ids | grep -E "(0|1|2|1025|0):(0|1|2|1025|0):"
> [pixelbeat ~]$ echo -ne $file_ids | grep -E
> "(0|1|2|3|4|5|6|7|8|9|10|65534|1025|48|0):(0|1|2|3|4|5|6|7|8|9|10|65534|1025|48|0)"
> 1025:243:file1
matches '5:2' (among other things)
> 243:1025:file2
matches '3:1'
> 243:243:file3
matches '3:2'
> [pixelbeat ~]$ echo -ne $file_ids | grep -E
> "(0|1|2|3|4|5|6|7|8|9|10|65534|1025|48|0):(0|1|2|3|4|5|6|7|8|9|10|65534|1025|48|0):"
> 243:1025:file2
matches '3:1'

Perhaps I'm missing something but it looks fine to me.

Gavin



This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:19:07 GMT