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

Re: [ -d (#i)Temp ]



On Fri, Apr 10, 2026 at 8:15 PM Roman Perepelitsa
<roman.perepelitsa@xxxxxxxxx> wrote:
>
> On Fri, Apr 10, 2026 at 7:28 PM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
> >
> > Is it possible to do something like this:?
> >
> >  [ -d (#i)Temp ] && echo 'it's a directory'
>
> [[ -d ''(#i)Temp(#qN) ]] && echo "it's a directory"

This one has a bug that triggers when there is more than one match for
(#i)Temp and not all matches are directories. The following does not
have this issue:

[[ -n ''(#i)Temp(#qN/) ]] && echo "there is at least one (#i)Temp dir"

Roman




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