Angus Leeming <[EMAIL PROTECTED]> writes:
what about [ `dirname "$1"` -ef `dirname "$2"` ] ?
"test -e FOO" is a bash extension. Also, "dirname" does nothing more than strip everything after the final '/' character. "/foo/bar/../baz.cpp" and "/foo/baz.cpp" will appear to be in different directories.
Correct for dirname, but -ef as well as cd+pwd will use the true directory.
Also I found '-ef' documented in the man page for ksh (SunOS 5.8) and BSD test, so I think it should be available on most platforms.
Hi Andreas,
yes, on Solaris it's available for ksh - but not for sh. (The standard shell for scripting and used by make.) So it's not true to say it's available for all (or most) platforms.
With kind regards,
Stephan