title: Correct Bash and shell script variable capitalization
body: <p>I run across many shell scripts with variables in all caps, and I've always thought that there is a severe misunderstanding with that.  My understanding is that, by convention (and perhaps by necessity long ago), <strong>environment variables</strong> are in all-caps.</p>
  
  <p>But in modern scripting environments like Bash, I have always preferred the convention of lower-case names for temporary variables, and upper-case ones <em>only for exported (i.e. environment) variables</em>.  For example:</p>
  
  <pre><code>#!/usr/bin/env bash
  year=`date +%Y`
  echo "It is $year."
  export JAVA_HOME="$HOME/java"
  </code></pre>
  
  <p>That has always been my take on things.  Are there any authoritative sources which either agree or disagree with this approach, or is it purely a matter of style?</p>