Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Problem with "?" symbol
- X-seq: zsh-users 15258
- From: "Benjamin R. Haskell" <zsh@xxxxxxxxxx>
- To: Nadav Har'El <nyh@xxxxxxxxxxxxxxxxxxx>
- Subject: Re: Problem with "?" symbol
- Date: Sun, 8 Aug 2010 09:50:58 -0400 (EDT)
- Cc: Dan Nelson <dnelson@xxxxxxxxxxxxxxx>, Manuel Presnitz <mpy@xxxxxxx>, zsh-users@xxxxxxx
- In-reply-to: <20100808124924.GB14294@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <aug3-8425220102@xxxxxxxxxxxxxxxxx> <20100803144657.GC58235@xxxxxxxxxxxxxxxx> <20100808124924.GB14294@xxxxxxxxxxxxxxxxxxxxxxxxxx>
On Sun, 8 Aug 2010, Nadav Har'El wrote:
> On Tue, Aug 03, 2010, Dan Nelson wrote about "Re: Problem with "?" symbol":
> > This can get you into trouble if you happen to have files matching
> > your wildcard in the current directory. "noglob" completely
> > disables globbing; "NO_NOMATCH" still tries to match the wildcard
> > but leaves it if there are no matches.
>
> When I last proposed making 'set +o nomatch' the default, like it is
> in Bourne shell, Ksh, and Bash, I got similar feedback - that it is
> dangerous because sometimes the wildcards do expand something, and
> sometimes they don't, etc. But has this ever actually caused problems
> for anybody? For me, it simply "does the right thing" most (if not
> all) of the time. The "nomatch" error always reminds of those "you
> forgot a semicolon at the end of the line" compilation errors in C -
> if you know I forgot something, why not help me and fix it for me? :-)
Detecting that something is wrong is much easier than knowing what the
correct fix is.
In the nomatch case, it bugs me (a lot) that other shells silently
convert the input I've given them into something that is not equivalent.
It commonly bites me with the '?' case (With '*' and '&', I usually
notice that I need to quote something), but I'd much rather it complain
than silently do something I don't intend. E.g. catching the typo in:
mv otherstuff impotrant* /backup/
(Probably a lame example, but the point about not changing my input in
ways I don't intend stands.)
> And considering that people coming from other shells (not including
> csh, which I wonder who continues to use) assume this feature, I still
> wonder why it's not the default in zsh.
For the same reason that SH_WORD_SPLIT isn't the default. "What other
shells do" isn't always the best indication of what Zsh users want.
(In my opinion, obviously.)
--
Best,
Ben
Messages sorted by:
Reverse Date,
Date,
Thread,
Author