Subject: Re: funny grep
To: Andrew Wheadon <andrew@wipux2.wifo.uni-mannheim.de>
From: Peter Galbavy <peter@wonderland.org>
List: current-users
Date: 04/18/1996 08:07:20
> bugs:*:101:100:Bug Filer:/home/hiwis/bugs:/bin/go
> x11:*:102:100:Mr. X:/home/hiwis/x11:/bin/go
> lp:*:110:32766:Max Hit Lp:/var/spool/laser1:/bin/go
> tftp:*:113:32766:Trivial Ftp:/:/dev/null
> ftp:*:200:32766:Anonymous Ftp,,,:/mit/ftp:/dev/null
> anon:*:200:32766:Anonymous Sup,,,:/mit/ftp/pub/NetBSD:/dev/null
> httpd:*:202:40:Humpty Dumpty:/usr/local/etc/httpd:/dev/null
> 
> <root@wipux2:~> grep -v [a-z] /etc/passwd
> tftp:*:113:32766:Trivial Ftp:/:/dev/null
> <root@wipux2:~>
> 
> Why is grep outputting the 'tftp' line ?

Try:

	grep -v '[a-z]' /etc/passwd

and the shell is likely expanding the [a-z] itself.

Regards,
-- 
Peter Galbavy                                           peter@wonderland.org
@ Home                                                 phone://44/973/499465
in Wonderland                              http://www.wonderland.org/~peter/
                               snail://UK/NW1_6LE/London/21_Harewood_Avenue/