Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Issue: Handling of globbing fails
- X-seq: zsh-workers 42361
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: Šimon Let <simon.a.let@xxxxxxxxx>, zsh-workers@xxxxxxx
- Subject: Re: Issue: Handling of globbing fails
- Date: Mon, 12 Feb 2018 17:03:04 +0000
- Cms-type: 201P
- Dkim-filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180212170310euoutp0144f7837f0672dd23ee77c7c7ffbaee27~SosTe8fql2213422134euoutp01N
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1518454990; bh=/e+WTNIM2o8FlWya5txtxP4SAkjQRmKim8kh8svZAUY=; h=Date:From:To:Subject:In-reply-to:References:From; b=i1Xw+9kXVVQLkQmt6pFdhKvpg0YH/hyP3cjUiER8/0yD8spLXqi5QXHnnALoohtEi yqrQd9cdxJHGC2LkM13DoE59Ysc888H3Vi3e4VkAz+L1TRbRQPe3na6S6M8uRqmf3T I9/zkiVF1IoH6PGT+Ehn6jdQgvbuBHhVnVZLiDN0=
- In-reply-to: <CAOdNpm8pHJDTe2vbdXbVSa7wmtFTW3k7Y641_-Yif42Hqsd6WA@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Organization: Samsung Cambridge Solution Centre
- References: <CGME20180212163514epcas5p34a9c8c3dd91cc702e72871cb009648ef@epcas5p3.samsung.com> <CAOdNpm8pHJDTe2vbdXbVSa7wmtFTW3k7Y641_-Yif42Hqsd6WA@mail.gmail.com>
On Mon, 12 Feb 2018 17:34:11 +0100
Šimon Let <simon.a.let@xxxxxxxxx> wrote:
> Consider running following command:
>
> `echo some_empty_directory/* && echo "NO FAIL" || echo "FAIL"`
>
> It produces following output:
>
> `zsh: no matches found: some_empty_dir/*`
Yes, it's an error, and is documented as such. Please read the
documentation for 'filename generation' and in particular the second
paragraph below where you'll also see how to modify it.
Shells have this sort of thing hard coded at a low level and have done
for a long time --- they can be counter-intuitive but I'm afraid reading
up about the subject is the only fix. We can recommend some "light"
reading on the subject, if you like...
FILENAME GENERATION
If a word contains an unquoted instance of one of the characters `*',
`(', `|', `<', `[', or `?', it is regarded as a pattern for filename
generation, unless the GLOB option is unset. If the EXTENDED_GLOB
option is set, the `^' and `#' characters also denote a pattern; other‐
wise they are not treated specially by the shell.
The word is replaced with a list of sorted filenames that match the
pattern. If no matching pattern is found, the shell gives an error
message, unless the NULL_GLOB option is set, in which case the word is
deleted; or unless the NOMATCH option is unset, in which case the word
is left unchanged.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author