Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: (N) defaults to whole directory listing
- X-seq: zsh-users 26439
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- Cc: Ray Andrews <rayandrews@xxxxxxxxxxx>, Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: (N) defaults to whole directory listing
- Date: Fri, 29 Jan 2021 11:04:20 -0800
- Archived-at: <https://zsh.org/users/26439>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-users/2021-01/CAH%2Bw%3D7bN7miEudLZcLknDQH3im%3Du8CCe_3GUqtEJMtyidV8bUg%40mail.gmail.com>
- In-reply-to: <CAN=4vMp+JykOWEYQ5qO495-hOpQXh+4RN6iHcYTP-APg8XHESQ@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <d611ab66-c6f9-655f-89dc-ded8697fe0ed@eastlink.ca> <CAN=4vMp+JykOWEYQ5qO495-hOpQXh+4RN6iHcYTP-APg8XHESQ@mail.gmail.com>
On Fri, Jan 29, 2021 at 7:33 AM Roman Perepelitsa
<roman.perepelitsa@xxxxxxxxx> wrote:
>
> print -rC1 -- no_such_file(N)
>
> This will print `no_such_file` if such file exists and will do nothing
> otherwise.
Not precisely nothing ... it will print a newline.
> ( ls -1 no_such_file(#q) ) 2>/dev/null
That can be done without a subshell:
{ ls no_such_file(#q) } 2>&-
However, that needs one of extendedglob or nobareglobqual, plus I
think he actually wants the error message.
To get the effect of (#q) without extendedglob, use (+true) ... but I
don't believe that's very useful in this specific example.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author