title: Getting negative on test for HOME directories with tilde ~ expansion
body: <p>I am getting a weird error, can't seem to figure out why.</p>
  
  <p>Especially because it works in one place but not in another scenario.</p>
  
  <p>I have his code that checks whether these directories exist -
  and the HOME dirs with ~ is failing in this code snippet:</p>
  
  <pre><code>if [[ ! -d "$valueToTest" ]]; then
      echo 'Failed&gt;&gt;:'$valueToTest;
  fi;
  </code></pre>
  
  <p>I get output:</p>
  
  <pre><code>Failed&gt;&gt;:~/.workspace/
  Failed&gt;&gt;:~/.ssh
  Failed&gt;&gt;:~/.workspace/vim/temp
  Failed&gt;&gt;:~/.workspace/vim/backup
  Failed&gt;&gt;:~/.workspace/vim
  Failed&gt;&gt;:~/test
  </code></pre>
  
  <p>Like I said it happens ONLY with the ~ expansion to represent my HOME directory.</p>
  
  <p>And this is the ONLY place this is happening as I have OTHER code that checks for path with ~ ie my HOME directory with ~ expansion, AND they work fine!</p>
  
  <p>The directories are being read from value part of an associative array - but I can't see why that would be a problem. Also you can see the output has no quotes or such associated with it.</p>
  
  <p>I have tried with and without double-quotes - no luck.</p>
  
  <p>As in:</p>
  
  <pre><code>$valueToTest
  ${valueToTest}
  "${valueToTest}"
  </code></pre>
  
  <p>Thank you for help.</p>