title: bash if -a vs -e option
body: <p>Both about <code>-a</code> and <code>-e</code> options in <a href="http://www.gnu.org/software/bash/manual/bashref.html#Bash-Conditional-Expressions" rel="noreferrer">Bash documentation</a> is said:</p>
  
  <pre><code>-a file
      True if file exists.
  -e file
      True if file exists. 
  </code></pre>
  
  <p>Trying to get what the difference is I ran the following script:</p>
  
  <pre><code>resin_dir=/Test/Resin_wheleph/Results
  
  if [ -e ${resin_dir} ] ; then
      echo "-e ";
  fi
  
  if [ ! -e ${resin_dir} ] ; then
      echo "! -e";
  fi
  
  if [ -a ${resin_dir} ] ; then
      echo "-a";
  fi
  
  if [ ! -a ${resin_dir} ] ; then
      echo "! -a";
  fi
  </code></pre>
  
  <p><code>/Test/Resin_wheleph/Results</code> exists and is a directory. And this is what I get:</p>
  
  <pre><code>-e
  -a
  ! -a
  </code></pre>
  
  <p>which seems to be a little strange (notice <code>-a</code> and  <code>! -a</code>). But when I use double brackets (e. g. <code>if [[ -e ${resin_dir} ]]</code>) in the similar script it gives reasonable output:</p>
  
  <pre><code>-e
  -a
  </code></pre>
  
  <p>So: </p>
  
  <ol>
  <li>What is a difference between <code>-a</code> and <code>-e</code> options?</li>
  <li>Why <code>-a</code> produces a strange result when used inside single brackets?</li>
  </ol>