[lsb-discuss] readlink

Craig.Scott at csiro.au Craig.Scott at csiro.au
Thu Feb 17 17:12:10 PST 2011

Sorry, I should have been clearer. I'm talking here about the *shell command*, not the C function.

On 18/02/2011, at 12:05 PM, Wichmann, Mats D wrote:

> lsb-discuss-bounces at lists.linux-foundation.org wrote:
>> Hi all. While looking for a way to robustly get the real
>> name/path of a script being run (ie find what $0 really points
>> to in a shell script), I came across lots of posts that
>> recommend the readlink command. Firing up the LSB navigator, I
>> can see that all of the linux distributions the navigator
>> covers seem to offer the readlink command except some PPC32
>> and S390 distributions, but readlink is not in any LSB version
>> for any platform. I was just wondering if anyone has looked at
>> this before and whether there are reasons why those few
>> platforms don't offer readlink? I can understand that while
>> some don't offer it, the inclusion of readlink in the LSB
>> would be hard to justify (ie confusion over some platforms
>> supporting it and not others).
> ummm, readlink has been part of LSB "forever" and it's in
> POSIX as well, which pretty much makes it automatic.
> the way distro information is gathered for use by navigator
> sometimes leads to a bit of confusion (happened to me,
> certainly), since it reflects all the variants found, and
> some of them are non-LSB.  If you look closer though, I think
> you'll see readlink/libc is "included since 1.0".

Dr Craig Scott
Computational Software Engineering Team Leader, CSIRO (CMIS)
Melbourne, Australia

More information about the lsb-discuss mailing list