Created
August 12, 2012 14:33
-
-
Save xtetsuji/3332091 to your computer and use it in GitHub Desktop.
Echo "JOJO!" if counting number is prime.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# require: factor | |
# note: Debian coreutils includes factor command and using it first setup. | |
for((i=1;;i++)) ; do factor $i | grep -E '^[0-9]+: [0-9]+$' >/dev/null 2>&1 && echo 'JOJO!' || echo $i ; sleep 1 ; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment