Re: [ -d (#i)Temp ]
Ray Andrews <[email protected]> Fri, 10 Apr 2026 11:34:41 -0700
| Newsgroups | gmane.comp.shells.zsh.devel,gmane.comp.shells.zsh.user |
|---|---|
| Message-ID | <[email protected]> |
@Perry Smith:
Nope, it's all about the case insensitivity.
On 2026-04-10 10:53, S. Cowles wrote:
>
> one solution: (note corrected name)
>
> [[ -d ${:-"$( echo (#i)Temp )"} ]] && echo "it's a directory" || echo
> no such dir
Mirabile dictu, it works! Pretty byzantine tho, I wonder if there's an
easier way. Still I'll take it, thanks. I understand the code except
for the ':-', what does that do? Oh, right about the double brackets, I
keep forgetting that.
Roman:
2 /aWorking/Zsh/Source/Wk 3 % md temp # in addition to /Temp
2 /aWorking/Zsh/Source/Wk 3 % [[ -d ''(#i)Temp(#qN) ]] && echo "it's a
directory"
2 /aWorking/Zsh/Source/Wk 3 % rm -r temp
2 /aWorking/Zsh/Source/Wk 3 % [[ -d ''(#i)Temp(#qN) ]] && echo "it's a
directory"
it's a directory
... seems to fail with more than one match, exactly as desired. Seems
perfect unless there' some gotcha.