Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [ -d (#i)Temp ]
On 2026-04-10 11:48, Roman Perepelitsa wrote:
It's checking for a directory named "Temp temp", which does not exist,
so you are getting the result you want by accident.
Well that's the story of my life with zsh. But you know, I've decided
to back out of this idea, it would end up biting me in the ass. Best as
it is now: if you want the contents of the directory, type the name
exactly. Not so hard.
The simplest way I know of to achieve what you want:
local d=( (#i)Temp(/N) )
[[ ${#d} == 1 ]] && echo "there is exactly one (#i)Temp directory"
... but that's nice clean code. Tx. for lesson, I'll save all that.
Note that this test succeeds if there is a directory named "temp" and
a regular file named "Temp". I presume that's what you want.
Roman
Messages sorted by:
Reverse Date,
Date,
Thread,
Author