title: Unix shell bit select
body: <p>How can I calculate bit selection from shell? <BR></p>
  
  <p>Suppose I've got something like: <code>i[m:l]</code></p>
  
  <p><code>i</code> is an integer, <code>m</code> is the MSB portion of the bit select and <code>l</code> is the LSB portion of the bit select, e.g.:</p>
  
  <ul>
  <li><code>250[1:0]</code> - would return the 2 LSB bits of "250", and answer will be "2"</li>
  <li><code>250[7:2]</code> - would return the 6 MSB bits of "250", and answer will be "62"</li>
  </ul>