I am trying to obtain the absolute path to the currently running script on OS X.
I saw many replies going for readlink -f $0
. However since OS X's readlink
is the same as BSD's, it just doesn't work (it works with GNU's version).
Is there an out-of-the-box solution to this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…