Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Filename generation: instruct zsh not to follow symbolic links?
- X-seq: zsh-users 30717
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Filename generation: instruct zsh not to follow symbolic links?
- Date: Fri, 17 Jul 2026 02:47:20 +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-20260327; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=G8tygCAo+9oiC2t+SRf/XwyAPuSpGchSjMvajSGBsJo=; fh=yk3c4scJWo86Za4IR1HBNZw2a+GkUkfVQ7Fs3jnanfg=; b=ETCdIK5ZhQzvR6E9zr9DXqokwllXJfEOCHKcFbd5D5kTed4k8rVb7U0HHoMFoWnKz5 1Ve8PHUsUNMrUtlj1aq4J5t+izPmk+GlY29GLy20UZ+v9lkxah8pLcw5P8uny2BKHghk XsQtPkMIrk0mUu5l+WWYBjXmrYQh7HmrZ9AZwzI8d+NcolJUkTHEH4guS27omhgsKkyA KzEarOWmES7j45LrY9WUUFf5jDfpfnauwV30KOslyHIe4lrPRxLvfg8nbZqWVsBtavYn VHZW3H6aUaxsVSItWgBqnRCnKRvKiLShJHExH8WidXiLWLgvJ8c8eKUVClUW+VN7R1Bo OFlw==; darn=zsh.org
- Arc-seal: i=1; a=rsa-sha256; t=1784249254; cv=none; d=google.com; s=arc-20260327; b=bNGnMYXkumeoNGHqxRvOIdP4tLhWPluR/LERvYz1eEz1k3QWVIBt1gx8OgD33Ql8vL KG+Q3nU70hurJvVkQ1PQP32gLEMohhUirN9hu3kGHvqtcEfvfF2MAqCkVsOPJ8L2d+wp pB126kXe3KHGwtDyLI92jNIiIdjWimNsp1bzHGXIUoPmPsg3IZt8PKh5PjwlymqO5K3J Ltucc9JWxxW36P3qUYFIHIH98CeuSBm6xwB/vEf/uPCn1N4O7qWr4tW7pP95/rbC2QwH 8Zazw+cKQnkjAYrRM9pC/7YhW3HeMzWx+RjQHiGLalBvjcxx8wAEpA5plrLuYFGsEZ52 nOUA==
- Archived-at: <https://zsh.org/users/30717>
- In-reply-to: <20260716225724.GB229319@qaa.vinc17.org>
- List-id: <zsh-users.zsh.org>
- References: <20260715231750.GB75013@qaa.vinc17.org> <CAHYJk3Trh7f1w41Dg5oWKGYPquFhtq6CDLO9tVJwzBQe2uJqcA@mail.gmail.com> <20260716092312.GA2955@cventin.lip.ens-lyon.fr> <CAHYJk3RjJOFvd9KYsjBgYPbkOsyo4BG30Jsy9uQ2U_-v-3h0UQ@mail.gmail.com> <20260716225724.GB229319@qaa.vinc17.org>
On Fri, Jul 17, 2026 at 1:36 AM Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
>
> On 2026-07-16 18:04:54 +0200, Mikael Magnusson wrote:
> > On Thu, Jul 16, 2026 at 11:35 AM Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
> > >
> > > On 2026-07-16 02:57:46 +0200, Mikael Magnusson wrote:
> > > > On Thu, Jul 16, 2026 at 1:47 AM Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
> > > > >
> > > > > In filename generation, is there a way to instruct zsh not to follow
> > > > > symbolic links?
> > > > >
> > > > > Unfortunately, it is not possible to use glob qualifiers on
> > > > > pathname components (except the last one, i.e. ending the pattern),
> > > > > e.g. *(/)/foo, even though there would be no ambiguity in parsing
> > > > > (because a slash cannot appear in a pathname component).
> > > >
> > > > No, but you can do things like
> > > > () { mycmd $^@/foo } *(/)
> > > > which conveniently doesn't need any named temporary parameters.
> > >
> > > I get "No such file or directory" errors for some directories.
> > > But this is too complex anyway, and perhaps not usable in some
> > > situations.
> >
> > Right, you might need
> > () { setopt localoptions cshnullglob; mycmd $^@/foo } *(/)
> > :)
>
> I still get "No such file or directory" errors; or if I use "echo"
> as the command, I get non-existing files in the output.
It was implied that foo is a pattern in the above, in which case the
cshnullglob wil filter out the nonexistant ones.
> > > I would rather think that a (/ sequence could have a special meaning.
> > > That should be easy to parse.
> >
> > Sure, but that'd be an extreme special case then. You wouldn't be able
> > to use any other glob qualifiers there.
>
> Why not?
Because the other glob qualifiers are not '/' and hence will not match
the (/ sequence.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author