title: Running script existing in another folder - paths
body: <p>I have three scripts:</p>
  
  <pre><code>-- bin
  ------ start.sh
  -- scripts
  ------ directory_a
  ------------ directory_b
  ------------------ script_1.sh
  ------------------ script_2.sh
  </code></pre>
  
  <p><em>start.sh</em> runs <em>script_1.sh</em>, and then <em>script_1.sh</em> runs <em>script_2.sh</em></p>
  
  <p>The problem is with paths:</p>
  
  <p><strong>start.sh:</strong></p>
  
  <pre><code>path_to_script="../scripts/directory_a/directory_b/script_1.sh";
  command="$path_to_script param1 param2";
  result=`$command`;
  </code></pre>
  
  <p><strong>script_1.sh:</strong></p>
  
  <pre><code>path_to_script="./script_2.sh";
  command="$path_to_script param1 param2";
  result=`$command`;
  </code></pre>
  
  <p>The problem is that <em>script_1.sh</em> is looking for <em>script_2.sh</em> in wrong directory:
  <strong>/bin/script_2.sh</strong>.</p>
  
  <p>I would like not to fix it by passing full path like this (because 'directory_a' name can change):</p>
  
  <p><strong>script_1.sh:</strong></p>
  
  <pre><code>path_to_script="../scripts/directory_a/directory_b/script_2.sh";
  command="$path_to_script param1 param2";
  result=`$command`;
  </code></pre>