coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: readlink(1) of more than one file?


From: Eric Blake
Subject: Re: readlink(1) of more than one file?
Date: Wed, 12 Dec 2012 13:00:22 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0

On 12/12/2012 12:54 PM, Pádraig Brady wrote:
> On 12/12/2012 07:05 PM, Aaron Davies wrote:
>> Is there a reason the interface for readlink(1) is “FILE” instead of
>> “FILE...”? I’ve often wanted to do e.g. “find -type l|xargs readlink”
>> or (in zsh) “readlink **/*(@)”, and having to do a shell loop or use
>> “xargs -n1” seems inelegant.
> 
> Note the newer more general realpath(1)
> supports multiple files.
> 
> Though there is no reason I see that readlink(1)
> can't do so too.  I also see the BSD version
> can accept multiple args, so I'll probably add
> something along the lines of the following
> unless there are objections.

If you add support for handling more than one file at a time, then you
also should add support for separating the output with NUL instead of
newline to make the output unambiguous.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]