Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: globbing on symlink target
- X-seq: zsh-users 23185
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Eitan Adler <lists@xxxxxxxxxxxxxx>
- Subject: Re: globbing on symlink target
- Date: Wed, 28 Feb 2018 20:31:28 +0100
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=mhhACFD9UDLGQ3lrqPPdNCptUskmm22TUc5nryoLtHM=; b=WwK/lYR5c5jPJUo/zlI97ULAfofcsPuzZWIr7C5DmorSTToNd63m65TqXbGXNuPbXy eBaXMc53eZcs4UmYaUnFFSgrtslk64fLqyYMPwKZ7lTh9ncBrhpsAD+SzdJJznzlt+kr YoKwuxnHK4MI84LaqbKBH2xXxzrYyCUVdqMkVkgCKhpE5Twf4ZIDdfKJE1x/R/7R14PL gwzIWZPlhggZCO5FojatdmF4LVMV65MryMFJA8v1g/M4zJJSnCWAW2yHQvdxyZlLOIKt IdWabshzgTi+/aDaPsKQ8yatzJ3SDeV1a3+nFUBjJ4OvvdipoWtQsbUgh+B0zj+lbJHk OvYg==
- In-reply-to: <CAF6rxgm_c+xMds+rzrBtd7LFbU_-4wOSpr8gbz1-Hu-yY9dNCA@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAF6rxgm_c+xMds+rzrBtd7LFbU_-4wOSpr8gbz1-Hu-yY9dNCA@mail.gmail.com>
On Wed, Feb 28, 2018 at 7:42 PM, Eitan Adler <lists@xxxxxxxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author