df -t nfs $ directory
returns two lines of output if the directory is installed on NFS and one line if it is not.
Some versions of df give an exit status of 1 if it is not mounted by NFS, but GNU coreutils 5.3.0 does not ...
if [ `df -t nfs . | wc -l` = 2 ];
Feels inelegant, and colleagues say that he doesn’t check errors enough. Is there a better way to do this?
source
share