I\'m writing a shell script that looks like this:
for i in $ACTIONS_DIR/* do if [ -x $i ]; then exec $i nap
exec never returns to the caller. Just try
if [ -x $i ]; then ./$i nap fi