Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: globbing on symlink target
- X-seq: zsh-users 23187
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: globbing on symlink target
- Date: Wed, 28 Feb 2018 23:19:27 +0100
- Cc: Eitan Adler <lists@xxxxxxxxxxxxxx>, 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=4/glFEqAcoLKIu0Xiis62X4vR8dFKS1BoS0K2RT2ipQ=; b=giesw+JOWAtrPjLh3bwTu6/NY+R809dB8w1MBNMyhGQp0mjbLob/xQggEuHUEYOkv1 4c2V2xGnyKHzDFWuFD6KhF02jJu1Xv0RA9/r4mHXIfGNfEXdRYG/0cS3l+rYaIyD2QPx 4zxYoLX8Bi/lKcBG9x/lKdc5T4j/6PbjTsX4TDqLzMBuvIOs8EYKJPXy3joonjlPNX9p 5Fh/TGZpxfGuFiG2j8VBiPMBT9czTFLgKWiOEjC9HwniJQSU7Ax9Ux/ql4/dwOaWfSEg hZS0OrAdOGSRp1x7NgTa92GPEbetKmU6mqCBbSuBvv+Lde/HtGvqfwPvhG5rP4303uf9 eIbg==
- In-reply-to: <CAH+w=7aZj5GWwOnSRVVmxK9c7MoiQyZJB6_UQfPMkzDxJSoitA@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> <CAHYJk3QPuo7mmsR1D7h8opwCzLQPBq_mfDem7=jojEk6zmA8-w@mail.gmail.com> <CAH+w=7aZj5GWwOnSRVVmxK9c7MoiQyZJB6_UQfPMkzDxJSoitA@mail.gmail.com>
On Wed, Feb 28, 2018 at 9:59 PM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Wed, Feb 28, 2018 at 11:31 AM, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>> 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.
>>
>> % 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
>
> Should be easier than that -- using Eitan example of files with a
> ".rb" extension:
>
> % ls *(@e^'[[ $REPLY:P = *.rb ]]'^)
Ah, that is indeed easier. I think you can't differentiate relative or
absolute symlinks with this method though, if you happen to care about
that.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author