Created
February 6, 2017 00:18
-
-
Save ueokande/a9105321521c8b6ea44d9442b083ba23 to your computer and use it in GitHub Desktop.
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/sh | |
print_primes() { | |
for i in `seq 6 $1`; do | |
test=$(echo $i | factor | awk 'NF==2{print $2}') | |
if [ -n "$test" ]; then | |
echo $i | |
fi | |
done | |
} | |
print_primes 20 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment