title: source command is not working with variables or quoted strings
body: <p>I am having a problem with this.</p>
  
  <p>If I do...</p>
  
  <pre><code>source /Users/cristian/Proyectos/MikroTik\ Updater/sources/testfile
  </code></pre>
  
  <p>It does work</p>
  
  <p>If I do...</p>
  
  <pre><code>source "/Users/cristian/Proyectos/MikroTik\ Updater/sources/testfile"
  </code></pre>
  
  <p>It doesn’t</p>
  
  <p>The problem is that I’m using a variable which contains a path got some steps before</p>
  
  <p>So this...</p>
  
  <pre><code>mypath="/Users/cristian/Proyectos/MikroTik\ Updater/sources/testfile"
  source $mypath
  </code></pre>
  
  <p>Doesn’t work neither</p>
  
  <p>I found a workaround doin...</p>
  
  <pre><code>eval "source $mypath"
  </code></pre>
  
  <p>But of course it is a big security hole because file name comes from an argument</p>
  
  <p>What can I do?</p>
  
  <p><strong>EDIT:</strong> </p>
  
  <p>As you can see in the code I echo the filename and then try to source it</p>
  
  <pre><code>updaterpath="$( cd "$(dirname "$0")" ; pwd -P | sed  's/ /\\ /g' )"
  sourcefile="$updaterpath/sources/$1"
  
  echo $sourcefile
  source $sourcefile
  </code></pre>
  
  <p>In the output I get the correct path echoed and the error from <code>source</code> saying it doesn't exists! The funny thing is that whether I <code>cat</code> that file, I can see the content, so the file path is correct!</p>
  
  <pre><code>/Users/cristian/Proyectos/MikroTik\ Updater/sources/testfile
  /Users/cristian/Proyectos/MikroTik Updater/updater.sh: line 7: /Users/cristian/Proyectos/MikroTik\: No such file or directory
  </code></pre>