Hacker News new | ask | show | jobs
by pixelbeat__ 929 days ago
All the main platforms have realpath(1). It was added to GNU Linux over 10 years ago now, to aid portability, and be a more natural command to access this functionality than readlink(1)
2 comments

Saw a comment on another site mention this, but NetBSD won't get it until 10.0 (not yet released) and OpenBSD got it in 7.1 (released last year). Of course I'm of the mindset that building complex shell scripts is simply an exercise in masochism so this all seems like a solution in search of a problem.
Not really. macOS until version 12 doesn’t have realpath(1), it was only added this year. You can’t rely on it for portable code.
To clarify, it was added (late) last year, with macos 13 (Ventura).