bashmod.sh 227 B

12345678910111213
  1. #! /bin/bash
  2. # Example of mod function in a loop
  3. start=`date +%s`
  4. for i in {1..100}; do
  5. if ((i % 20 == 0)); then
  6. echo $i
  7. sleep 1
  8. now=`date +%s`
  9. echo start: $start now: $now elapsed: $((now-start))
  10. fi
  11. done