Skip to content

Instantly share code, notes, and snippets.

Created January 6, 2015 23:13
Show Gist options
  • Save anonymous/0ca762a4da36a1c53f86 to your computer and use it in GitHub Desktop.
Save anonymous/0ca762a4da36a1c53f86 to your computer and use it in GitHub Desktop.
something involving division and possibly case
#!/usr/bin/bash
for x in {1..100}
do if (( $x % 3 == 0)) && (( $x % 5 == 0 ))
then echo fizzbuzz
elif (( $x % 3 == 0 ))
then echo fizz
elif (( $x % 5 == 0 ))
then echo buzz
else echo "$x"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment