We Recommend

bash Cookbook: Solutions and Examples for bash Users bash Cookbook: Solutions and Examples for bash Users
bash Cookbook teaches shell scripting the way Unix masters practice the craft. It presents a variety of recipes and tricks for all levels of shell programmers so that anyone can become a proficient user of the most common Unix shell -- the bash shell -- and cygwin or other popular Unix emulation packages.


Posted By

kergoth on 05/15/08


Tagged

path nfs


Versions (?)


Determine if a path is in an nfs mount


Published in: Bash 


This is useful if you have some optional functionality being done which is quite slow on nfs. For example, I have a script that adds scm (svn/git/etc) info to my prompt, but I wouldn't want that when I'm in a repository on an nfs mount.

  1. if [ "$(stat -f -c "%T" $path)" = "nfs" ]; then
  2. # $path is in an nfs mount
  3. fi

Report this snippet 

You need to login to post a comment.