Unix list absolute file name
- by Matthew Adams
Given an arbitrary single argument representing a file (or directory, device, etc), how do I get the absolute path of the argument?
I've seen many answers to this question involving find/ls/stat/readlink and $PWD, but none that suits my need. It looks like the closest answer is ksh's "whence" command, but I need it to work in sh/bash.
Assume a…