Advertisement
Snuggledash

random duck

Jun 16th, 2020
1,063
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.26 KB | None | 0 0
  1. quacks=("HONK HONK HONK" "quack!" "QUACK!" "squawk!")
  2. # $RANDOM provides 15 bits of randomness, for a proper uniform distribution
  3. # the array size must be a power of two or you have to re-roll as needed.
  4. cowsay -f duck "${quacks[$((RANDOM & 0x3))]}"
  5. unset quacks
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement