|
|
Log in / Subscribe / Register

A report from the documentation maintainer

A report from the documentation maintainer

Posted Oct 30, 2016 21:59 UTC (Sun) by neilbrown (subscriber, #359)
In reply to: A report from the documentation maintainer by lsl
Parent article: A report from the documentation maintainer

> I thought everyone sets their LC_COLLATE to C (C.UTF-8, if supported) anyway to preserve their sanity. You don't?

Yes. Yes! A thousand times YES.

> Fire up bash and try this:
> > case b in [A-Z]) echo upper;; *) echo lower;; esac
> Changed your mind?

Or better:

> rm [A-Z]*

WHAT! It removed all the files which names starting with a lower case letter !?!?!


to post comments

A report from the documentation maintainer

Posted Oct 31, 2016 0:32 UTC (Mon) by mathstuf (subscriber, #69389) [Link] (1 responses)

Two solutions: stop using a buggy shell or use {A..Z} which doesn't have the problem. Well, a third would be to have bash expand globs on <Tab> like Zsh can[1], but I don't know how to do that.

[1]`rm a*<Tab>` becomes `rm afile adir` and so on.

A report from the documentation maintainer

Posted Oct 31, 2016 16:13 UTC (Mon) by nybble41 (subscriber, #55106) [Link]

> use {A..Z} which doesn't have the problem

That has a different problem: Unlike the glob pattern [A-Z], the braces expand to every letter from A to Z, even if some of them don't match:

$ echo [A-D]*
Desktop Documents Downloads
$ echo {A..D}*
A* B* C* Desktop Documents Downloads

> have bash expand globs on <Tab> like Zsh can[1]

The readline command for this in Bash is glob-expand-word (C-x *).


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds