On Tue, Aug 9, 2011 at 7:29 PM, Bernd Eggink <[email protected]> wrote:
> On 09.08.2011 03:44, Jon Seymour wrote:
>>
>> Has anyone ever come across an equivalent to Linux's readlink -f that
>> is implemented purely in bash?
>
> You can find my version here:
>
> http://sudrala.de/en_d/shell-getlink.html
>
> As it contains some corrections from Greg Wooledge, it should handle even
> pathological situations. ;)
>
> Bernd
>
Thanks for that. ${link##*-> } is a neater way to extract the link.
It does seem that a link create like so: ln -sf "a -> b" c is going to
create problems for both your script and mine [ not that I actually
care about such a perverse case :-) ]
jon.