title: Determine interpreter from inside script
body: <p>I have a script; it needs to use bash's associative arrays (trust me on that one).</p>
  
  <p>It needs to run on normal machines, as well as a certain additional machine that has /bin/bash 3.2.</p>
  
  <p>It works fine if I declare the interpreter to be <code>/opt/userwriteablefolder/bin/bash4</code>, the location of bash 4.2 that I put there.. but it then only works on that machine.</p>
  
  <p>I would like to have a test at the beginning of my script that checks what the interpreting shell is, and if it's bash3.2, calls <code>bash4 $0 $@</code>.  The problem is that I can't figure out any way to determine what the interpreting shell is.  I would really rather not do a $HOSTNAME based decision, but that will work if necessary (It's also awkward, because it needs to pass a "we've done this already" flag).</p>
  
  <p>For a couple reasons, "Just have two scripts" is not a good solution.</p>