title: Extract all variable values in a shell script
body: <p>I'm debugging an old shell script; I want to check the values of all the variables used, it's a huge ugly script with approx more than 140 variables used. Is there anyway I can extract the variable names from the script and put them in a convenient pattern like:</p>
  
  <pre><code>#!/bin/sh
  if [ ${BLAH} ....
  .....
  rm -rf ${JUNK}.....
  </code></pre>
  
  <p>to</p>
  
  <pre><code>echo ${BLAH}
  echo ${JUNK}
  ...
  </code></pre>