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

Re: [ -d (#i)Temp ]



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"

> I'd expect it to fail if there's more than one match

The snippet I posted above will succeed if there is one or more
matches. I don't know of a simple one-liner that will succeed only
when there is exactly one match.

Roman




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