From: Mikael Magnusson <mikachu@gmail.com>
To: Eitan Adler <lists@eitanadler.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: globbing on symlink target
Date: Wed, 28 Feb 2018 20:31:28 +0100 [thread overview]
Message-ID: <CAHYJk3QPuo7mmsR1D7h8opwCzLQPBq_mfDem7=jojEk6zmA8-w@mail.gmail.com> (raw)
In-Reply-To: <CAF6rxgm_c+xMds+rzrBtd7LFbU_-4wOSpr8gbz1-Hu-yY9dNCA@mail.gmail.com>
On Wed, Feb 28, 2018 at 7:42 PM, Eitan Adler <lists@eitanadler.com> wrote:
> Is it possible to glob on a symlink target rather than the symlink
> name. For example I have several symlinks that *point to* filenames of
> the form ABX.rb but themselves have no pattern to match on. I could
> write a loop and use readlink but would prefer to use glob syntax for
> interactive use.
% ls -l *(@)
lrwxrwxrwx 1 mikaelh users 3 Feb 28 16:50 broken -> foo
lrwxrwxrwx 1 mikaelh users 3 Feb 28 20:27 broken2 -> bar
lrwxrwxrwx 1 mikaelh users 3 Feb 28 20:27 hello -> foo
% echo *(e*'local -A foo; zstat -LH foo $REPLY; [[ $foo[link] == foo ]]'*)
broken hello
It is arguable if this is interactive use syntax. You could write a
wrapper function but then you need to quote foo (again).
--
Mikael Magnusson
next prev parent reply other threads:[~2018-02-28 19:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-28 18:42 Eitan Adler
2018-02-28 19:31 ` Mikael Magnusson [this message]
2018-02-28 20:59 ` Bart Schaefer
2018-02-28 22:19 ` Mikael Magnusson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAHYJk3QPuo7mmsR1D7h8opwCzLQPBq_mfDem7=jojEk6zmA8-w@mail.gmail.com' \
--to=mikachu@gmail.com \
--cc=lists@eitanadler.com \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).