[PLUG] bash surprise

Chris Jantzen chris at maybe.net
Fri Feb 13 11:01:01 UTC 2004


On Fri, Feb 13, 2004 at 10:54:30AM -0800, Michael Rasmussen wrote:
> On Fri, Feb 13, 2004 at 10:47:43AM -0800, Bill Spears wrote:
> > Try this:
> > $ echo B | grep [a-z]
> > 
> > Cure seems to be LC_ALL=C.
> > 
> > I thought my system, Fedora1, was plain Jane vanilla.  The fact that
> > this wasn't set right really surprised me.
> 
> um, beg to differ here, but the 'cure' is:
> 
> $ echo B | grep -i [a-z]
> 
> It's good to keep upper and lower case distinct.  Unless you explicitly want
> them munged together.

Yeah, not at all clear what the desired result he wanted was.

Another caveat -- if there are any files called "a", "b", et. al. bash
will do glob expansion on [a-z] so you'd better either escape or
single-quote.

-- 
chris kb7rnl =->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.pdxlinux.org/pipermail/plug/attachments/20040213/deb4f3f3/attachment.asc>


More information about the PLUG mailing list