[lsb-discuss] readlink

Craig Scott audiofanatic at gmail.com
Wed Feb 23 15:22:07 PST 2011

I can confirm that Mac OSX does also have a readlink command (I'm working on Mac at the moment, but don't tell anyone :-P ). Not that it matters for the LSB, but it does seem to add weight that the GNU license issue probably isn't a blocker. My understanding of the LSB though is that it mostly reflects what is already common for existing linux distributions. So going back to my original question, I guess it really comes down to whether having readlink on only *some* of the LSB-supported platforms is a blocker to including it in the LSB standard (it would seem that it is/should be).

In case anyone else comes back to this thread wanting to do what my original post outlined, readlink on its own as a naked command actually won't do it for you. It needs to be called repeatedly until it returns an empty string before you can be sure all symbolic links have been followed. Interestingly, the google results I followed never seemed to mention this, so if you have symlinks pointing to other symlinks, you need more than a single readlink command to reach the ultimate target.

On 24/02/2011, at 2:53 AM, Jeff Licquia wrote:

> On 02/18/2011 08:54 AM, Wichmann, Mats D wrote:
>> and readlink-the-command comes from GNU coreutils, which is
>> GPLv3 licensed - something which seems to scare certain
>> people to death (presumably because they can't TIVO-ize their
>> products) so I believe it would be pretty hard to include as
>> mandatory in LSB... at least until alternate sources exist
>> (I've heard in the Mac world there is such a thing, but since
>> I don't play around there I don't really know)
> On Linux distributions, a number of our requirements come from GNU 
> coreutils.  I see id, split, yes, and uniq on just a quick scan.
> This seems to indicate that there are alternatives to GNU coreutils for 
> readlink:
> http://nixdoc.net/man-pages/freebsd/man1/readlink.1.html
> I think it's worth considering, at least.
> _______________________________________________
> lsb-discuss mailing list
> lsb-discuss at lists.linux-foundation.org
> https://lists.linux-foundation.org/mailman/listinfo/lsb-discuss

Craig Scott
Melbourne, Australia

More information about the lsb-discuss mailing list