title: Shell Script and spaces in path
body: <p>I have larger shell script which handles different things. </p>
  
  <p>It will get it's own location by the following...</p>
  
  <pre><code>BASEDIR=`dirname $0`/..
  BASEDIR=`(cd "$BASEDIR"; pwd)`
  </code></pre>
  
  <p>then BASEDIR will be used create other variables like</p>
  
  <pre><code>REPO="$BASEDIR"/repo
  </code></pre>
  
  <p>But the problem is that this shell script does not work if the path contains spaces where it is currently executed.</p>
  
  <p>So the question is: Does exist a good solution to solve that problem ?</p>