title: pushd does not go into specified directory
body: <p>I am trying to go into a directory using <code>pushd</code></p>
  
  <pre><code> #!/bin/bash
  
   function cloneAll {
     [ -d ~/mapTrials ] || mkdir ~/mapTrials
     pushd '~/mapTrials/'
     echo $(pwd)
     popd
  }
  </code></pre>
  
  <p>The <code>echo $(pwd)</code> gives me the same working directory that I called the script from.</p>
  
  <p>I read in other SO answers that pushd is only for child processes and that I have to create an alias for it. I have done that also. </p>
  
  <p>I tried doing some commands like <code>mkdir</code> to see where it would be created. It is being created in the directory I called the script from and not the directory specified in <code>pushd</code>. </p>
  
  <p>How do I get this working? How do I get into a specific directory in a shell script and then do commands inside that directory??</p>
  
  <p>Thanks in advance.</p>