The code below works just fine as long as the exit status equals 0, however I'd like the script to exit after 3 times if the exit status is non-zero. Right now the script continues on even if the exit status is non-zero after the 3 iterations.
for run in {1..3}
do
kinit $USER
if [ $? -eq 0...