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 30708
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Filename generation: instruct zsh not to follow symbolic links?
- Date: Thu, 16 Jul 2026 18:04:54 +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=OtNut0at4tZgMGe9xAK2al4QpSByHW/k0Qd7kMkJAq0=; fh=yk3c4scJWo86Za4IR1HBNZw2a+GkUkfVQ7Fs3jnanfg=; b=Fc7LAqtusIvMffejBsKZHOqhaFItjigtcv4ORq+T2K7ZhnAwQZT4H6gK/XxYi+mA7+ ie5aFJ0VQudkwwIfwv7ScuaG/cGxRNZX+cZ2Psy3xXPboM+yEUfBcenmcZv+/6SqDmKM BL2S5FVJ3GCteDdAhw7QLoGzw9UPRtIj2zlKDF7cZDvmbbL4m5oAnHTCcI0gF20OehWx 0T/WpLN6oAHzjSdR/TSxCMjjGT6iWi6OsVQAK6/1iJ41NAmg/misydIrn2tMRy11Av5v JqxhdOhspg5zwWORXNh1Nl3pzvoyhUMR0+COoEzhNjU0LMy459E+/dSLeaSLPeIa1AYD 44Ww==; darn=zsh.org
- Arc-seal: i=1; a=rsa-sha256; t=1784217908; cv=none; d=google.com; s=arc-20260327; b=akcZDYnyTAtpycbma7w1yqwgsrUX8jl4rcpMqEf4TX5SzL6CQSZgB5HHK1Kw0JWSww IjAfHiQVusRJcNnPAwmhUbMoOE54IFDuVu30iSmKahbR5vdc2zASlo8XGLDuILPGlJTX lLnFvcE1ce4IjYTu+5yw4XFp1YXW08KtZEevQ+BCZOyfYLMBuQ8b8CWga2OdDtMstXm2 IvWYXcBN/c8clRf0RDpX+pGaBB3k8i2/5CIvsHPSAgzfCdCr8ieGdtr3sAvEiwMh0fXh ochpGfGVgOfDXvaxKf+PffxTwCRN4tSRAbMXESMC7E+nsLa+F3KnIcD6NDR9r3g6obJK 9c8g==
- Archived-at: <https://zsh.org/users/30708>
- In-reply-to: <20260716092312.GA2955@cventin.lip.ens-lyon.fr>
- List-id: <zsh-users.zsh.org>
- References: <20260715231750.GB75013@qaa.vinc17.org> <CAHYJk3Trh7f1w41Dg5oWKGYPquFhtq6CDLO9tVJwzBQe2uJqcA@mail.gmail.com> <20260716092312.GA2955@cventin.lip.ens-lyon.fr>
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 } *(/)
:)
> > fwiw, this is perfectly valid:
> > bing/(bar/)#foo
> > so the parsing might be less easy than you think. (Unless you were
> > thinking about looking for the )/ sequence? Maybe that would work, but
> > who can say for sure). I'm not exactly sure what you mean by "because
> > a slash cannot appear in a pathname component", are you referring to
> > the / inside the (/) or the one after? Because obviously all other
> > glob qualifiers are not the '/' character.
>
> 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.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author