title: Bash bad substitution
body: <p>I'm working on a tiny script for school that has for goal to get a bmp file's size (file as parameter) using a single command line (no ; or &amp;&amp;)</p>
  
  <p>So I did this :</p>
  
  <pre><code>#!/bin/bash
  
  echo "size : ${$(xxd -p -seek 02 -l 4 $1):6:2}${$(xxd -p -seek 02 -l 4 $1):4:2}${$(xxd -p -seek     02 -l 4 $1):2:2}${$(xxd -p -seek 02 -l 4 $1):0:2} bytes"
  </code></pre>
  
  <p>But when executed (using bash or execution) it returns the following error :</p>
  
  <pre><code>./script.sh: line 3: size : ${$(xxd -p -seek 02 -l 4 $1):6:2}${$(xxd -p -seek 02 -l 4 $1):4:2}${$(xxd -p -seek 02 -l 4 $1):2:2}${$(xxd -p -seek 02 -l 4 $1):0:2} bytes: bad substitution
  </code></pre>
  
  <p>Which I do not know how to get rid of, may you guys help me solve this problem ?</p>