Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [ -d (#i)Temp ]
- X-seq: zsh-users 30522
- 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:19:43 +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=o4tmqyxREmWaYko60NV0t44biSAMKWBxfnDy/FFs6g0=; fh=jPiVBPZEfwBf151+XrsNuwNUZll4fQOLSzRxlVE23MQ=; b=WtZoLOIguOw5JdDXaoINPgubVWqxfFp87dhvMpKxb51Z1LAbqeonRffVtzRaPpDtu6 IFb2ZcmkQdOR9Gs37lgf5F5UZjzBsXDb6zS1npJ2C4p6ackWN0Hd0PxGipsn0q4AbFrK pfBqyT5ZAtY7qw2oX4ktGI5RWl0Xg3gDkbbTYfcUXnrOWERVVJrJa2Phm7o/2CQMfi7k uJJSOJTqZXu3tXy4XUx5P8eYB2l9A1kK+8uulb8F7pzuas7p8tNid9RUNaduJR+UUNkd eUaBHby7gWo1smFZyiwDY2KHH+GcNp5AB4UG873306Y9+3EduogHTfnIN8w8OSCjyKrx qknQ==; darn=zsh.org
- Arc-seal: i=1; a=rsa-sha256; t=1775845195; cv=none; d=google.com; s=arc-20240605; b=PfjUVjDq4VyXL8IkPUs/h/dDVE4FI+RM47aY3QLu9cP02yzl49UJ31xf6g2dDLRZFc 7f2DPAsI3RqHwWt9BtUOBaPmxf40WvRcvmkcUUifWQ+N6hreqpG0I7P8ipzaThizOorU XRUOgwliIA7wICUzWBsWhf3NyS5HjAF3IWbiQcfa9IVcX+07V2AEu78tjnCWygG5Fn/n jpi4f24NRwibEpC7wrS6MCLjV9yUe2HPV7vod6Kl97N123ehboYrm239DkEKw4Q6XpxC UNEgSO9dWz6fnYMB4N/cbYAFgfkrKliYq+nIb5QtSH1Tu9kYfvSZL+P13XFAwWC+nC7E BICQ==
- Archived-at: <https://zsh.org/users/30522>
- In-reply-to: <CAN=4vMrQ=pORSJTw5qrv6k5pTJzRXQa+vh_k46yT+FzmgktdkA@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <dcc675da-fa5b-422c-bd63-748886ff1858@eastlink.ca> <CAN=4vMrQ=pORSJTw5qrv6k5pTJzRXQa+vh_k46yT+FzmgktdkA@mail.gmail.com>
On Fri, Apr 10, 2026 at 8:15 PM Roman Perepelitsa
<roman.perepelitsa@xxxxxxxxx> wrote:
>
> 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"
This one has a bug that triggers when there is more than one match for
(#i)Temp and not all matches are directories. The following does not
have this issue:
[[ -n ''(#i)Temp(#qN/) ]] && echo "there is at least one (#i)Temp dir"
Roman
Messages sorted by:
Reverse Date,
Date,
Thread,
Author