<html><head></head><body><div><div>Yeah. What he said.</div><div><br></div><div>From my F22 bash-land (4.3.39):</div><div><br></div><div>touch a.pdf A.pdf b.pdf B.pdf c.pdf C.pdf z.pdf Z.pdf</div><div>[<a href="mailto:jkinney@dhcp061167">jkinney@dhcp061167</a> tmp]$ ls</div><div>a.pdf A.pdf b.pdf B.pdf c.pdf C.pdf z.pdf Z.pdf</div><div>[<a href="mailto:jkinney@dhcp061167">jkinney@dhcp061167</a> tmp]$ ls | grep "[A-Z].pdf"</div><div>A.pdf</div><div>B.pdf</div><div>C.pdf</div><div>Z.pdf</div><div>[<a href="mailto:jkinney@dhcp061167">jkinney@dhcp061167</a> tmp]$ ls | grep "[a-z].pdf"</div><div>a.pdf</div><div>b.pdf</div><div>c.pdf</div><div>z.pdf</div></div><div><br></div><div>On Wed, 2015-08-26 at 15:41 -0400, Ed Cashin wrote:</div><blockquote type="cite"><div dir="ltr">I've been biting my tongue here. I don't think these characteristics of bash are congruent with UNIX philosophy. The people who made UNIX complain about bash being bloated. These characteristics of bash are congruent with POSIX philosophy.<div><br></div><div>A UNIX-ish way of doing this would be ...</div><div><br></div><div> ls | grep '^[A-Z].*\.pdf'</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 26, 2015 at 1:41 PM, Jim Kinney <span dir="ltr"><<a href="mailto:jim.kinney@gmail.com" target="_blank">jim.kinney@gmail.com</a>></span> wrote:<br><blockquote type="cite"><p dir="ltr">Wow! Shopt has enough options to make it stand next to emacs.</p>
<p dir="ltr">I don't understand why the default is essentially case insensitive when everything else in bash is case sensitive. It looks like the LANG makes it work that way but that makes no sense either to me. A != a in standard US English. </p>
<p dir="ltr">More of the secret mysteries of Unix philosophy I've never wrapped my head around.</p><div class="HOEnZb"><div class="h5">
<div class="gmail_quote">On Aug 26, 2015 12:16 PM, "Scott Plante" <<a href="mailto:splante@insightsys.com" target="_blank">splante@insightsys.com</a>> wrote:<br type="attribution"><blockquote type="cite"><br>
I didn't know the globasciiranges option.<br>
<br>
Another solution is the LC_COLLATE variable:<br>
<br>
splante:/tmp/x/> ls<br>
a.pdf A.pdf b.pdf B.pdf<br>
splante:/tmp/x/> ls [A-Z].pdf<br>
A.pdf b.pdf B.pdf<br>
splante:/tmp/x/> LC_COLLATE=C<br>
splante:/tmp/x/> ls [A-Z].pdf<br>
A.pdf B.pdf<br>
splante:/tmp/x/> LC_COLLATE=en_US<br>
splante:/tmp/x/> ls [A-Z].pdf<br>
A.pdf b.pdf B.pdf<br>
<br>
This is probably a better solution:<br>
<br>
splante:/tmp/x/> ls [[:upper:]].pdf<br>
A.pdf B.pdf<br>
<br>
<br>
Scott<br>
<br>
<br>
----- Original Message -----<br>
<br>
From: "Alex Carver" <<a href="mailto:agcarver%2Bale@acarver.net" target="_blank">agcarver+ale@acarver.net</a>><br>
To: <a href="mailto:ale@ale.org" target="_blank">ale@ale.org</a><br>
Sent: Wednesday, August 26, 2015 11:34:02 AM<br>
Subject: Re: [ale] BASHing my head<br>
<br>
You need to set the shopt globasciiranges otherwise it uses the values<br>
as lexical rather than pure ASCII values.<br>
<br>
<br>
On 2015-08-26 08:22, Scott M. Jones wrote:<br>
> For some reason my wildcard search in bash starting with uppercase<br>
> letters is finding files starting with lower case. I checked my 'shopt'<br>
> options and they should be correct, but changing them doesn't change the<br>
> results. In this case I DO want a case sensitive search but I'm not<br>
> getting that. What am I doing wrong? (Fedora 21 bash BTW.)<br>
><br>
> [scott@vbox21 tentcards]$ echo $SHELL<br>
> /bin/bash<br>
> [scott@vbox21 tentcards]$ ls [A-Z]*.pdf<br>
> no_materials.pdf tentcard.pdf tentcard_short.pdf tents.pdf<br>
> tents_short.pdf<br>
> [scott@vbox21 tentcards]$ shopt | grep -i case<br>
> nocaseglob off<br>
> nocasematch off<br>
> [scott@vbox21 tentcards]$ shopt -s nocaseglob<br>
> [scott@vbox21 tentcards]$ shopt -s nocasematch<br>
> [scott@vbox21 tentcards]$ ls [A-Z]*.pdf<br>
> no_materials.pdf tentcard.pdf tentcard_short.pdf tents.pdf<br>
> tents_short.pdf<br>
> [scott@vbox21 tentcards]$ shopt | grep -i case<br>
> nocaseglob on<br>
> nocasematch on<br>
> [scott@vbox21 tentcards]$<br>
> _______________________________________________<br>
> Ale mailing list<br>
> <a href="mailto:Ale@ale.org" target="_blank">Ale@ale.org</a><br>
> <a href="http://mail.ale.org/mailman/listinfo/ale" rel="noreferrer" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
> See JOBS, ANNOUNCE and SCHOOLS lists at<br>
> <a href="http://mail.ale.org/mailman/listinfo" rel="noreferrer" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
><br>
<br>
_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org" target="_blank">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" rel="noreferrer" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" rel="noreferrer" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org" target="_blank">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" rel="noreferrer" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" rel="noreferrer" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
<br></blockquote></div>
</div></div><br>_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" rel="noreferrer" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" rel="noreferrer" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"> Ed Cashin <<a href="mailto:ecashin@noserose.net" target="_blank">ecashin@noserose.net</a>></div></div>
</div>
</blockquote><div class="-x-evo-signature-wrapper"><span><pre>--
James P. Kinney III
Every time you stop a school, you will have to build a jail. What you
gain at one end you lose at the other. It's like feeding a dog on his
own tail. It won't fatten the dog.
- Speech 11/23/1900 Mark Twain
http://heretothereideas.blogspot.com/
</pre></span></div></body></html>