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

Re: [ -d (#i)Temp ]



On Fri, Apr 10, 2026 at 8:49 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> A better construction might be to use the "test" builtin:
>
> test -d (#i)Temp && echo "it's a directory"

This does not work if nothing matches (#i)Temp, with and without nullglob.

% ls
% unsetopt nullglob
% test -d (#i)Temp && echo "it's a directory"
zsh: no matches found: (#i)Temp
% setopt nullglob
% test -d (#i)Temp && echo "it's a directory"
it's a directory

Roman




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