Advertisement
quantumech

Untitled

May 18th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.25 KB | None | 0 0
  1. n=0
  2.  
  3. while true
  4. do
  5.     # If 'n' is even, print 'Tick'
  6.     if (( $n % 2 == 0 ))
  7.     then
  8.         echo "Tick"
  9.     # Else print 'Tock'
  10.     else
  11.         echo "Tock"
  12.     fi
  13.  
  14.     # Increment 'n'
  15.     (( n++ ))
  16.  
  17.     # Pause program for a second before printing next message
  18.     sleep 1
  19. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement