title: How to expand relative paths in shell script
body: <p>I am writing a script to set environment variables on linux 2.6 using bash.
  So the script contains commands like:</p>
  
  <pre><code>export SRC_DIR=..
  export LIBPATH=${SRC_DIR}/lib
  </code></pre>
  
  <p>the problem is that when i try to do echo $LIBPATH, it shows "../lib" as opposed to expanding the SRC_DIR to full path. I would really like the script to print something like /home/x/lib as opposed to ../lib. </p>
  
  <p>UPDATE
  The script should evaluate SRC_DIR to be one directory upwards from the script's location and not the current directory from where the script is invoked</p>