2011-03-23

Do shell writers not care where they are?

Bash has dirname and basename and there is the ever present $PWD; but has no built-in mechanism for determining what the absolute path name of a file or directory.  I find this infuriating.  Did someone think that people would never need to know?  Did someone impose their view that absolute or full pathnames are evil and should never be used within a script?

Ok, I'm overstating the problem.  There is the workaround of using "readlink -f" command but it was not obvious and I was only lucky to stumble across it recently.  I had to have a separate script otherwise.