I've symlinked a script file into my ~/bin, and when I do which foo
the output is:
/Users/me/bin/foo
Is there a way to have this resolve the symlink and show me the real file?
With zsh
:
print -r =foo(:A)
Or if foo
is in the $cmd
variable:
print -r $cmd:c:A
/Users
suggests he's on macOS and macOS'readlink
doesn't support the-f
option. – Stéphane Chazelas Aug 23 '17 at 09:28