I\'m writing a shell script which parses the path of the current working directory (printing a like of all basenames above the current directory).
So far, I\'ve been usi
If it were me, I'd use pwd since it is a built-in both for bash and sh. That does not mean they work identically in all respects, but if you are invoking it without options, that shouldn't matter.
pwd