Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: (-) doesn't make (e) working on the files which symbolic links point to ?



On Fri, Oct 24, 2014 at 8:28 AM, Han Pingtian <hanpt@xxxxxxxxxxxxxxxxxx> wrote:
> On Thu, Oct 23, 2014 at 08:22:53PM -0700, Bart Schaefer wrote:
>> On Oct 24, 10:14am, Han Pingtian wrote:
>> }
>> } Looks like the qualifer "(-)" doesn't make "(e)" works on files pointed
>> } by symblic
>>
>> The only thing that (-) controls is whether the file attributes are read
>> by lstat() or stat().  It does not cause a readlink(); note that even in
>> the absence of (e), the names returned by *(@-) are the names of the links
>> and not of the files linked-to.
>>
>
> Thanks.
>
>> You want (:A) like so:
>>
>>     ls -l /dev/disk/by-id/*(:Ae'.[[ $REPLY = *sda* ]].')
>
> I'm sorry, it doesn't work. The outputs of "*(:Ae'.[[ $REPLY = *sda* ]].')"
> is the same as "*(:A)".
>

It would appear that :A causes the e to not execute at all, but in
either case the end result would not be the desired one. The following
works, if your zsh is new enough to allow globbing in this context.
ls -l /dev/disk/by-id/*(e.'[[ $REPLY(#q:A) = *sda* ]]'.)

-- 
Mikael Magnusson



Messages sorted by: Reverse Date, Date, Thread, Author