Bash 4.2 + extras, 102 / 9! = 0.00028108
c=(w man grep $[2**($1%73)%-1] sed ! curl curl ! ! / -) a=("" "" "" "" "" "" _ 0) ${c[$1%58]} ${a[$1]} Supports exit codes 0, 1, 2, 4, 6, 7, 126, 127, and 136.
TIO's bash is too new. Currently working on a permalink.
Verification
$ for n in 0 1 2 4 6 7 126 127 136; do bash exit.sh $n ; echo $? >&0; done &>- 0 1 2 4 6 7 126 127 136 How it works (incomplete)
grep will exit successfully (exit code 0) if it can find at least one match, fail (exit code 1) if there are no matches, and exit with 2 if there are any syntax errors.
For input 0, the pattern
$1{$1,1}becomes0{0,1}, which matches zero or one zeroes, so grep exits with 0.For input 1, the pattern becomes
1{1,1}, which fails with exit code 1 since there are no matches on STDIN.For input 2, the pattern becomes
2{2,1}, which fails with exit code 2 since the limits are out of order.