title: What does expanding a variable as "${var%%r*}" mean in bash?
body: <p>I've got the following variable set in bash:</p>
  
  <pre><code>ver=$(/usr/lib/virtualbox/VBoxManage -v | tail -1)
  </code></pre>
  
  <p>then I have the following variable which I do not quite understand:</p>
  
  <pre><code>pkg_ver="${ver%%r*}"
  </code></pre>
  
  <p>Could anyone elaborate on what this does, and how <code>pkg_ver</code> is related to the original <code>ver</code> value?</p>