On I am on MacOS, but looking for a cross-platform solution that will also work on *nix. Simple question, how can I resolve this path with bash a script?
/Users/Olegzandr/.nvm/versions/node/v7.2.0/bin/../lib/node_modules/suman/cli/cli.sh
This path is made up of two pieces which I have in hand:
/Users/Olegzandr/.nvm/versions/node/v7.2.0/bin
and
../lib/node_modules/suman/cli/cli.sh
what is the best way to get an absolute path that represents the resolution of those two paths?
Note that my Mac has readlink
on it, but it doesn't appear to be the same utility as that on *nix machine. Most importantly, my readlink
utility does not have the -f
option that *nix utility probably does, so I can't seem to use that.