title: Retrieve bash version in AIX
body: <p>After the shellshock issue detected on Unix systems with bash, I have to create a script as part of my internship in a firm in order to update bash.</p>
  
  <p>Prerequisites to the installation of the updated IBM bash*.rpm are:</p>
  
  <ul>
  <li>having bash installed (simple check)</li>
  <li>having bash version under 4.2.50</li>
  </ul>
  
  <p>I have a problem dealing with the second part, since the true bash version is given by command     <code>bash -version</code>     instead of     <code>rpm -qi bash</code>     which essentially gives the version/release of the installation package (and not neccessarily the true bash version).</p>
  
  <p>Basically, my script goes like this:</p>
  
  <pre><code>if [[ bash installed ]] ; then
    if [[ bash version installed is &lt; 4.2.50 ]] ; then
      install bash version 4.2.50
    fi
  fi
  </code></pre>
  
  <p><code>bash -version</code> returns a lot of text, and I would like to pick out the bash version.</p>
  
  <p>So far, I've used the following command:</p>
  
  <pre><code>$ bash -version | grep version | awk '{print $4}' | head -n 1
  </code></pre>
  
  <p>That returns :</p>
  
  <pre><code>4.2.50(1)-release
  </code></pre>
  
  <p>Is there any way to retrieve the real bash version? I've played around with the <code>sed</code> command with no success.</p>