title: Shell commands not working when grouped in a bash script
body: <p>I have this file:</p>
  
  <pre><code>file.txt:
    4003f0:   48 83 ec 08             sub    $0x8,%rsp
    4003f4:   e8 73 00 00 00          callq  40046c
  </code></pre>
  
  <p>I am trying to extract the opcodes from the middle. First I search the first element after the opcodes (sub and callq):</p>
  
  <pre><code>get_asm_index.awk: 
  BEGIN {
      i_min = 1000000;
  }
  
  {
      i = match($0, /[^ :0-9a-fA-F]/)
      if(i &lt; i_min)
          i_min = i;
  }
  
  END {
      print i_min;
  }
  </code></pre>
  
  <p>After that I print the opcodes:</p>
  
  <pre><code>get_hexdump.awk:
  {
      i = match($0, /[:]/);
      print substr($0, i+1, i_min-i-1);
  } 
  </code></pre>
  
  <p>Everything is working if I call the two awk files separately, but I get the following error when I group them in a shell script:</p>
  
  <pre><code>./do.sh: line 4: 48: command not found
  </code></pre>
  
  <p>The shell script:</p>
  
  <pre><code>do.sh:
  #!/bin/bash
  i_min=$(awk -f get_asm_index.awk file.txt)
  $(awk -v i_min="$i_min" -f get_hexdump.awk file.txt)
  </code></pre>