Created
June 19, 2023 07:50
-
-
Save Hermann-SW/eb39744899bf308365426ae64b0ff0c5 to your computer and use it in GitHub Desktop.
shows difference for "list of largest 5000 primes"
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 | |
wget -O /tmp/all.txt https://t5k.org/primes/lists/all.txt 2> /dev/null | |
if [ ! -f t5k.org_primes_lists_all.txt ] | |
then | |
echo "initial download of largest primes list" | |
cp /tmp/all.txt t5k.org_primes_lists_all.txt | |
fi | |
if [ ! -f t5k.org_primes_lists_all.txt.old ] | |
then | |
cp t5k.org_primes_lists_all.txt t5k.org_primes_lists_all.txt.old | |
fi | |
diff t5k.org_primes_lists_all.txt /tmp/all.txt > /dev/null | |
if [ "$?" == "1" ] | |
then | |
echo "file downloaded is different" | |
mv t5k.org_primes_lists_all.txt t5k.org_primes_lists_all.txt.old | |
cp /tmp/all.txt t5k.org_primes_lists_all.txt | |
fi | |
diff <(cut -b7- t5k.org_primes_lists_all.txt.old) <(cut -b7- t5k.org_primes_lists_all.txt) --side-by-side -W 160 | egrep "(<|>|\|)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
List of 5000 largest primes:
https://t5k.org/primes/lists/all.txt
Sample script output: