Re: [ -d (#i)Temp ]
"S. Cowles" <[email protected]> Fri, 10 Apr 2026 10:53:08 -0700 (PDT)
| Newsgroups | gmane.comp.shells.zsh.devel,gmane.comp.shells.zsh.user |
|---|---|
| Message-ID | <[email protected]> |
one solution:
[[ -d ${:-"$( echo (#i)Tmp )"} ]] && echo "it's a directory" || echo no such dir
notes:
1) single brackets are bash / sh (more overhead). double brackets are the zsh builtin.
2) quoting on the return message.
On Fri, 10 Apr 2026, Ray Andrews wrote:
> From: Ray Andrews <[email protected]>
> Subject: [ -d (#i)Temp ]
> Is it possible to do something like this:?
> [ -d (#i)Temp ] && echo 'it's a directory'
> ... that doesn't work, but you get the idea: I have a directory 'temp' and
> I'm wanting the above test to succeed. As with wildcards, even if it did
> make a match, I'd expect it to fail if there's more than one match of
> course. I'm betting this is doable.
--
sidcowles at sonic dot net