title: What are the rules for valid identifiers (e.g. functions, vars, etc) in Bash?
body: <p>What are the syntax rules for identifiers, especially function and variable names, in Bash?</p>
  
  <p>I wrote a Bash script and tested it on various versions of Bash on Ubuntu, Debian, Red Hat 5 and 6, and even an old Solaris 8 box. The script ran well, so it shipped.</p>
  
  <p>Yet when a user tried it on SUSE machines, it gave a "not a valid identifier" error. Fortunately, my guess that there was an invalid character in the function name was right. The hyphens were messing it up.</p>
  
  <p>The fact that a script that was at least somewhat tested would have completely different behaviour on another Bash or distro was disconcerting. How can I avoid this?</p>