title: No code will run after `exec` in bash script
body: <p>Sample bash script where I'm testing using variable expansion in command names:</p>
  
  <p><strong>test_command_w_variable_expansion_in_name.sh</strong>:</p>
  
  <pre><code>#!/bin/bash
  
  # Gabriel Staples
  # 21 Mar. 2020
  
  echo "PATH = \"$PATH\""
  # PATH="$HOME/bin:$PATH"
  # echo "PATH = \"$PATH\""
  
  # 1st, create a command in ~/bin to test here
  mkdir -p ~/bin
  echo -e "#!/bin/bash\necho \"This is a test script found in ~/bin.\"" &gt; ~/bin/gs_test_script
  chmod +x ~/bin/gs_test_script
  
  # 1)
  # command: `echo`
  CMD_PREFIX="ec"
  
  ${CMD_PREFIX}ho "hey" # works
  # exec "${CMD_PREFIX}ho" "hey" # works, but then prevents the code below from running!
  # eval "${CMD_PREFIX}ho" "hey" # does NOT work, but also throws no error
  
  # 2)
  # command: `gs_test_script` from ~/bin
  CMD_PREFIX="gs_test"
  
  ~/bin/gs_test_script # works!
  gs_test_script # works!
  ${CMD_PREFIX}_script # works!
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>$ ./test_command_w_variable_expansion_in_name.sh
  PATH = "/home/gabriel/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
  hey
  This is a test script found in ~/bin.
  This is a test script found in ~/bin.
  This is a test script found in ~/bin.
  </code></pre>
  
  <p>Questions:</p>
  
  <ol>
  <li><p>Now, if I uncomment this line: <code># exec "${CMD_PREFIX}ho" "hey" # works, but then prevents the code below from running!</code>, the code below it no longer runs, and I get this output instead! Notice I no longer get the 3 printouts of <code>This is a test script found in ~/bin.</code> <strong>Why?</strong></p>
  
  <pre><code>$ ./test_command_w_variable_expansion_in_name.sh
  PATH = "/home/gabriel/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
  hey
  hey
  </code></pre></li>
  <li><p>Also, the <code>eval</code> command just below it doesn't work. If I uncomment out that line I get the exact same erroneous output as posted just above, which still doesn't execute my call to <code>gs_test_script</code> three times like it should. Why?</p></li>
  </ol>