readlink - Unix

This is a discussion on readlink - Unix ; Is there any readlink-replacement for OSs that doesn't have it, and that is better than sedding the output of `ls'? -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life!...

+ Reply to Thread
Results 1 to 4 of 4

Thread: readlink

  1. readlink

    Is there any readlink-replacement for OSs that doesn't have it, and
    that is better than sedding the output of `ls'?
    --
    ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
    http://www.barzilay.org/ Maze is Life!

  2. Re: readlink

    2006-04-26, 09:30(-04), Eli Barzilay:
    > Is there any readlink-replacement for OSs that doesn't have it, and
    > that is better than sedding the output of `ls'?


    perl.

    Though the equivalent of readlink -f is not straightforward.

    perl -le 'print readlink(shift)' -- "$file"

    --
    Stéphane

  3. Re: readlink

    Stephane CHAZELAS writes:

    > 2006-04-26, 09:30(-04), Eli Barzilay:
    > > Is there any readlink-replacement for OSs that doesn't have it, and
    > > that is better than sedding the output of `ls'?

    >
    > perl.
    >
    > Though the equivalent of readlink -f is not straightforward.
    >
    > perl -le 'print readlink(shift)' -- "$file"


    The point is to have something very lightweight, and very
    least-common-denominator. I think that ls+sed would be lighter than
    running perl, plus perl might not be there in really bad setups...

    --
    ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
    http://www.barzilay.org/ Maze is Life!

  4. Re: readlink

    Eli Barzilay wrote/schrieb :

    > Is there any readlink-replacement for OSs that doesn't have it, and
    > that is better than sedding the output of `ls'?


    Maybe ``realpath'':

    |$ apt-cache show realpath
    |Package: realpath
    |Priority: optional
    |Section: utils
    |Installed-Size: 72
    |Maintainer: Robert Luberda
    |Architecture: amd64
    |Source: dwww
    |Version: 1.9.23
    |Replaces: dwww (<= 1.6.10)
    |Depends: libc6 (>= 2.3.4-1)
    |Filename: pool/main/d/dwww/realpath_1.9.23_amd64.deb
    |Size: 24012
    |MD5sum: 6fd2567ea8c9d6a2d24d04f79158afbf
    |Description: Return the canonicalized absolute pathname
    | The package contains a small utility realpath, which converts each
    | pathname argument to an absolute pathname, which has no components
    | that are symbolic links or the special . or .. directory entries.
    | .
    | This utility provides mostly the same functionality as `/bin/readlink -f'
    | in the coreutils package.
    |Bugs: mailto:ubuntu-users@lists.ubuntu.com
    |Origin: Ubuntu

    Good luck
    Thomas

+ Reply to Thread