[ILUG] grep problems

Stephen Shirley diamond at skynet.ie
Fri Sep 27 15:30:03 IST 2002


On Fri, Sep 27, 2002 at 03:13:51PM +0100, Padraig Brady wrote:
> Can anyone explain the following
> (there should be no output from any of the greps below).
> 
> [pixelbeat ~]$ grep --version
> grep (GNU grep) 2.5.1
> [pixelbeat ~]$ file_ids="1025:243:file1\n243:1025:file2\n243:243:file3\n"
> [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

Surely that's right, with the 1025 matching before the :, and the 2
matching afterwards. Maybe i'm missing something.

Steve
-- 
High salt diets are bad for you - but only outside marriage.



More information about the ILUG mailing list