I'd like to retrieve the absolute file name of the script file that's currently executed. Links should be resolved, too.
On Linux, this seems to be done like this:
$(readlink -mn "$0")
readlink seems to work very differently on Mac OS X.
I've read that this is done using
in BSD but that doesn't work, either. Mac OS X does not have