Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [ -d (#i)Temp ]
- X-seq: zsh-users 30521
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Ray Andrews <rayandrews@xxxxxxxxxxx>
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: [ -d (#i)Temp ]
- Date: Fri, 10 Apr 2026 20:15:07 +0200
- Arc-authentication-results: i=1; mx.google.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=932oJ2v1FjMSuAfU3jeRwXdmSCWAYAL85EPLHGYwUgo=; fh=jPiVBPZEfwBf151+XrsNuwNUZll4fQOLSzRxlVE23MQ=; b=gPVSt69vDzLtKJ7c6zn0l50z6wUOsTGifs5TfV1m3Id0bCg9pdPqpbCIPU33T3F5pa rK+J9B64NQaqxAYE3LDk0DrLee3kypA3wy/2AkgFANSaWmAVn5gpb+danLQxLnCp23c3 Reys7lVrwJ1KEx6k3MDLqbIzFHvV4HlD6w9AYVUF/PqNDB8nlUHKJokmhUBCBcoK3sdM w0GFziu424YVBZ5i4bB6dkZ70GmNvYGCjmF6+haoErjJ5mmvAATNCLNkXOLw07stzRQE U/IKVCapUvCOcTRP7K2n0A9au/MfSydrcg8pX2huyWG+nbTBMAdIN1rRkVCu4j1u9EDN G6fw==; darn=zsh.org
- Arc-seal: i=1; a=rsa-sha256; t=1775844919; cv=none; d=google.com; s=arc-20240605; b=G6SmAi5XopPUb0A5v6bJBjYA+2w+wrSw7XeLzyGbVjhcXXxvJ0EWJbCkCf6JpOoFBy BRZKE6HCiCU7oRS6kTm1ODX7c5Dv0DDuw34DimDVmxp8CnZbq713ls8j07J3ivJiyX6g xHIVOviGPPCt4TI6GKMbpWlESk9SfHI++H5u0/uDJLBi0Ce19bNKKAmP5/o0gWeq32Fx CTY3pYGP948Kn0XQjWub6y1FWwanSYmdDBL5HaAJ+7e8P8tIePO61cHjyCVzvuIm3iZg 7quNUq9jOXOhpFbhbjHv3dJ4jx0C0hcmimT6zE8ayGOSAiJtD70J8OxKOOxoJE9auG77 K3sA==
- Archived-at: <https://zsh.org/users/30521>
- In-reply-to: <dcc675da-fa5b-422c-bd63-748886ff1858@eastlink.ca>
- List-id: <zsh-users.zsh.org>
- References: <dcc675da-fa5b-422c-bd63-748886ff1858@eastlink.ca>
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