[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: equivalent of Linux readlink -f in pure bash?
From: |
Jon Seymour |
Subject: |
Re: equivalent of Linux readlink -f in pure bash? |
Date: |
Tue, 9 Aug 2011 13:24:54 +1000 |
On Tue, Aug 9, 2011 at 12:49 PM, Bob Proulx <bob@proulx.com> wrote:
> Jon Seymour wrote:
>> Has anyone ever come across an equivalent to Linux's readlink -f that
>> is implemented purely in bash?
>>
>> (I need readlink's function on AIX where it doesn't seem to be available).
>
> Try this:
>
> ls -l /path/to/some/link | awk '{print$NF}'
>
> Sure it doesn't handle whitespace in filenames but what classic AIX
> Unix symlink would have whitespace in it? :-)
>
readlink -f will fully resolve links in the path itself (rather than
link at the end of the path), which was the behaviour I needed.
It seems cd -P does most of what I need for directories and so
handling things other than directories is a small tweak on that.
Anyway, thanks for that!
jon.
- equivalent of Linux readlink -f in pure bash?, Jon Seymour, 2011/08/08
- Re: equivalent of Linux readlink -f in pure bash?, Bob Proulx, 2011/08/08
- Re: equivalent of Linux readlink -f in pure bash?,
Jon Seymour <=
- Re: equivalent of Linux readlink -f in pure bash?, Bob Proulx, 2011/08/08
- Re: equivalent of Linux readlink -f in pure bash?, Jon Seymour, 2011/08/09
- Re: equivalent of Linux readlink -f in pure bash?, Bob Proulx, 2011/08/09
- Re: equivalent of Linux readlink -f in pure bash?, Jon Seymour, 2011/08/09
- Re: equivalent of Linux readlink -f in pure bash?, Jon Seymour, 2011/08/09
- Re: equivalent of Linux readlink -f in pure bash?, Bob Proulx, 2011/08/09
- Re: equivalent of Linux readlink -f in pure bash?, Jon Seymour, 2011/08/09
- Re: equivalent of Linux readlink -f in pure bash?, Andreas Schwab, 2011/08/09
Re: equivalent of Linux readlink -f in pure bash?, Bernd Eggink, 2011/08/09