title: How to find if a directory is a mount in ShellScript
body: <p>I need to find if a location is a  directory and if it is a mount in ShellScript</p>
  
  <p>I tried this:</p>
  
  <pre><code>new_dir="/home/fruits/apple"
  if [ -d "$new_dir" ]
  then
      if [ mountpoint -q "$new_dir" ]
      then
          echo "directory is mounted"
      else
          echo "directory is not mounted"
      fi
  fi
  </code></pre>
  
  <p>But it is not working.
  gives error like</p>
  
  <pre><code>test_dir.sh: line 13: [: -q: binary operator expected
  directory is not mounted
  </code></pre>
  
  <p>Can someone help... I need this working...</p>