title: How to obtain the full PATH, *allowing* for symbolic links
body: <p>I have written bash scripts that accept a directory name as an argument.  A single dot ('.') is a valid directory name, but I sometimes need to know where '.' is.  The <code>readlink</code> and <code>realpath</code> commands provide a resolved path, which does not help because I need to allow for symbolic links.</p>
  
  <p>For example, the resolved path to the given directory might be something like <code>/mnt/vol_01/and/then/some</code>, whereas the script is called with '.' where '.' is <code>/app/then/some</code> (a sym link which would resolve to the first path I gave).</p>
  
  <p>What I have done to solve my problem is use <code>cd</code> and <code>pwd</code> in combination to provide the full path I want, and it seems to have worked OK so far.</p>
  
  <p>A simplified example of a script:</p>
  
  <pre><code>DEST_DIR=$1
  
  # Convert the given destination directory to a full path, ALLOWING 
  # for symbolic links.  This is necessary in cases where '.' is 
  # given as the destination directory.
  DEST_DIR=$(cd $DEST_DIR &amp;&amp; pwd -L)
  
  # Do stuff in $DEST_DIR
  </code></pre>
  
  <p>My question is:  is my use of <code>cd</code> and <code>pwd</code> the best way to get what I want?  Or is there a better way?</p>