title: Check if a directory contains another directory
body: <p>How do I check if a given directory contains another directory in shell. I want to pass 2 full path directories. (I know this is stupid, but just for learning purposes). Then I want to see if any one of those 2 paths is contained in the other one. </p>
  
  <pre><code>parent=$1
  child=$2
  
  if [ -d $child ]; then
      echo "YES"
  else
      echo "NO"
  fi
  </code></pre>
  
  <p>this however makes no use of the parent directory. Only checks if the child exists.</p>