[lsb-discuss] readlink

Wichmann, Mats D mats.d.wichmann at intel.com
Thu Feb 17 17:05:06 PST 2011

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".

More information about the lsb-discuss mailing list