#!/usr/bin/bash # run the program will all different exit types: for type in --exit --exit_ --return --abort --fall; do echo echo "running myExit with " $type echo myExit $type echo echo "Exit Code: " $? echo echo read -p "Press enter to continue: " junk done echo echo echo "Trying some different exit codes" echo echo # try running the program with a few different exit values for code in 1 2 3 513 1023 2049 -1; do for type in --exit --exit_ --return; do echo echo "running myExit with " $type --code $code echo myExit $type --code $code echo echo "Exit Code: " $? echo echo read -p "Press enter to continue: " junk done; done;