title: My shell script stops after exec
body: <p>I'm writing a shell script that looks like this:</p>
  
  <pre><code> for i in $ACTIONS_DIR/*
      do
              if [ -x $i ]; then
                      exec $i nap
              fi
      done
  </code></pre>
  
  <p>Now, what I'm trying to achieve is to list every file in $ACTIONS_DIR to be able to execute it. Each file under $ACTIONS_DIR is another shell script. </p>
  
  <p>Now, the problem here is that after using exec the script stops and doesn't go to the next file in line. Any ideas why might this be?</p>