title: How to get the Bash version number
body: <p>I'm writing a script which requires the Bash version number in a simple short format.</p>
  <p>I'm aware of <code>bash --version</code>, but this gives a long output:</p>
  <pre><code>GNU bash, version 4.2.10(1)-release (i686-pc-linux-gnu)
  Copyright (C) 2011 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;
  
  This is free software; you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.
  </code></pre>
  <p>This could be cut down to the bit I want, <code>4.2.10</code>, by this:</p>
  <pre><code>bash --version | grep &quot;bash&quot; | cut -f 4 -d &quot; &quot; | cut -d &quot;-&quot; -f 1  | cut -d &quot;(&quot; -f 1
  </code></pre>
  <p>However, this feels like it would be prone to break if that message ever changed slightly for whatever reason.</p>
  <p>Is there a better way to do this, and what is this better way?</p>