title: count the number of items in a shell variable
body: <p>I have a shell variable sampleDir:</p>
  
  <pre><code>sampleDir=/home/sample*
  echo $sampleDir
  </code></pre>
  
  <p>will give:</p>
  
  <pre><code>/home/sample_001 /home/sample_002 /home/sample_003
  </code></pre>
  
  <p>(note there are sub-directories under the sample_*** ones)</p>
  
  <p>If I would like to count how much of these items are in this $sampleDir variable, what would be a best way please? (Expect to return 3)</p>