title: Shell Scripting: Using a variable to define a path
body: <p>My problem lies with my confusion with <strong>shell variables</strong>.</p>
  
  <p>To my understanding, variables allow me to store a value (String in this case) and to call it later in my code.  So if I wanted to have a <strong>variable that holds the path</strong> to some set of scripts, I could ideally just store it like this:</p>
  
  <pre><code>SPTH = '/home/Foo/Documents/Programs/ShellScripts/Butler'
  
  //Later on in the script//
  cd $SPTH
  ./script1
  </code></pre>
  
  <p>What I'm trying to do, with probably the wrong syntax, is to set the path to <strong>variable <code>SPTH</code></strong>.</p>
  
  <p>Then I use <code>cd</code> with argument <code>$SPTH</code>.</p>
  
  <p>Ideally this would allow me to <strong>run the file there without typing in the path</strong>.  However it doesn't work.  The <strong><code>$SPTH</code></strong> is ignored and the result is as if <strong><code>cd</code></strong> was used alone.</p>
  
  <p>So what am I doing wrong? And what would be a way to do this?</p>