Linux systems have a
/bin/mountpoint which can be used to check if a particular directory is a mount point for a volume. Does Mac OS X have an equivalent program, or is there some other way to run this check?
You can parse the output of
Alternatively, read the exit code of
If, for whatever reason you want the real mountpoint, do the following:
You can use
This sed construct is used to get mount point which may include space in path. Notice usage of OS X's sed extended regexps option '-E', which is also unofficially supported by GNU sed (as GNU sed '-r' option). Portable command:
You can use it in bash functions: