Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug: Ubuntu apt-get install package-*

On 10 Nov, Bart wrote:
> On Nov 10, 10:43pm, Bob wrote:
> }
> } When I run install commands with `*` for all packages I get a zsh error
> } while it works in bash.
> Maybe it's time for something like this?
> (Truly horrible implementation follows, don't commit this, presented
> for example purposes only, etc. etc.)

> torch% echo bl?or*      
> zsh: correct 'bl?or*' to 'bl\?or\*' [nyae]? y
> bl?or*

An interesting idea. Given that correction happens before globbing
I can't think of any particularly sane criteria for when to trigger
this correction. The "horrible implementation" seems to take anything
two characters in length or longer and ~ is not regarded as a pattern
character. So haswilds must be returning false for just '*' or '?' which
seems odd.

So as it is, it would just be irritating because it would offer a
correction virtually every time you attempt to use a glob. If you defer
the correction to when a glob fails then it could be irritating if a
glob gets used in a loop and it could mean that a complex command
combination might be half-way through already before you see a
correction that would warrant an abort or edit response.

And without making this the default, it probably won't help the situation
much for bash exiles expecting nonomatch behaviour.


Messages sorted by: Reverse Date, Date, Thread, Author