[lug] grep question

Collins Richey crichey at gmail.com
Sun Jun 10 20:04:52 MDT 2007


On 6/10/07, Chip Atkinson <chip at pupman.com> wrote:
> Greetings,
>
> I'm trying to figure this one out:
>
> $ echo abcdefg | /usr/bin/grep "[A-Z]"
> abcdefg
>
> $ echo abcdefg | /usr/bin/grep -E "[A-Z]"
> abcdefg
>
>
> I always thought "[A-Z]" represented the characters A through Z, and not
> the characters a through z.
>
> Any ideas?
>
> Thanks in advance.
>

A few things.

1. You have a weird system. grep is /bin/grep on any normal Linux system.
2. Your grep example produces no output, ie pattern not found, on my system.
3. You must have something in your environment or a script in
/usr/bin/grep that is forcing a case sensitive scan.

Enjoy,
-- 
Collins Richey
     If you fill your heart with regrets of yesterday and the worries
     of tomorrow, you have no today to be thankful for.



More information about the LUG mailing list