Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: possible bug in zsh - stderr not redirected if unsatisfied wildcard
- X-seq: zsh-workers 53458
- From: Lawrence Velázquez <larryv@xxxxxxx>
- To: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>, "Ross Boulet" <rossb@xxxxxxxxx>
- Cc: zsh-workers@xxxxxxx
- Subject: Re: possible bug in zsh - stderr not redirected if unsatisfied wildcard
- Date: Mon, 07 Apr 2025 21:00:44 -0400
- Archived-at: <https://zsh.org/workers/53458>
- Feedback-id: iaa214773:Fastmail
- In-reply-to: <CAH+w=7ZE4Axr0XcuoS7tfeJh2M_4sCqbf2PP=At7JYgTn-8BoQ@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <SA0PR19MB420580218D3A5168E5FAF404B5AA2@SA0PR19MB4205.namprd19.prod.outlook.com> <CAH+w=7ZE4Axr0XcuoS7tfeJh2M_4sCqbf2PP=At7JYgTn-8BoQ@mail.gmail.com>
On Mon, Apr 7, 2025, at 7:13 PM, Bart Schaefer wrote:
> On Mon, Apr 7, 2025 at 4:03 PM Ross Boulet <rossb@xxxxxxxxx> wrote:
>>
>> cartman2% ls ?? >stdout2 2>stderr2
>>
>> zsh: no matches found: ?? ß error not redirected, stdout2 and stderr2 not created
>
> This is expected behavior, globbing takes place very early in the
> command interpretation process.
FWIW bash behaves the same way with failglob enabled.
% cat /tmp/failglob.bash
shopt -s failglob
rm -fr /tmp/foo
mkdir /tmp/foo
cd /tmp/foo
touch a b
ls ?? >stdout 2>stderr
ls -1
% bash /tmp/failglob.bash
/tmp/failglob.bash: line 9: no match: ??
a
b
%
--
vq
Messages sorted by:
Reverse Date,
Date,
Thread,
Author