fork download
  1. #!/bin/bash
  2. # ^^ make sure you have a valid shebang
  3. iterations=1000
  4. count_error=0
  5. count_expected=0
  6. for ((counter=0; counter < iterations; ++counter)); do
  7. if [[ $(($RANDOM % 2)) == 1 ]]; then
  8. count_error=$((count_error + 1))
  9. else
  10. count_expected=$((count_expected + 1))
  11. fi
  12. #sleep 0.1
  13. done
  14. echo count_error=$count_error count_expected=$count_expected
  15.  
Success #stdin #stdout 0.02s 5028KB
stdin
Standard input is empty
stdout
count_error=491 count_expected=509