LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Sorting files in BASH (https://www.linuxquestions.org/questions/linux-newbie-8/sorting-files-in-bash-407140/)

Dtsazza 01-26-2006 04:42 AM

Yep! But it does make sense.

I was going to mention the [[:upper:]] meta-class earlier (must have slipped my mind); it's probably a good habit to get into, since it apparently works with Unicode uppercase characters that aren't 'between' ASCII 'A' and ASCII 'Z'. I'd expect that it'd work for grep even with your locales set as they originally were.

muha 01-26-2006 06:03 AM

Ok, so our ls |grep ^[A-Z] example is equivalent to ls |grep ^[[:upper:]]
And: ls |grep ^[a-z] is the same as: ls |grep ^[[:lower:]]
Hmm, that goes quite well for sinister Black magic ;)
I'll try stick to the metaclass ones since they are locale-independent. Thanks Dtsazza!
For more classes see: man grep


All times are GMT -5. The time now is 11:04 AM.