Is there a way to portably (at least Linux and macOS) get the destination of a symlink in a (Posix) shell script? In an old program, I found
ls -lad "bin" 2> /dev/null | awk '{ printf ("%s\n", $11) }'
which however fails when user name or group name contains spaces.
stat(1) (which IMO would be the canonical solution) has different options on Linux and macOS.