1
0
Fork 0
mirror of https://github.com/sbrl/bin.git synced 2018-01-10 21:33:46 +00:00

Improve randomness of quote-get

This commit is contained in:
Starbeamrainbowlabs 2017-11-11 22:40:21 +00:00
parent 663ddd5ab1
commit 0fcb2b592f

View file

@ -7,7 +7,7 @@ if [[ "$#" -lt "1" ]]; then
echo -e "Quote generation tool"
echo -e "By Starbeamrainbowlabs"
echo -e ""
echo -e "Downloads and caches a quote file and picks out a random (per day) quote."
echo -e "Downloads and caches a quote file and picks out a random quote."
echo -e ""
echo -e "Usage:"
echo -e " quote-get {quote-file-url}"
@ -47,4 +47,4 @@ RANDOM=$(date +%Y%m%d);
quote_line=$((( $RANDOM % ${quote_count} )));
sed -n ${quote_line}p "${quotes_cache_file}";
cat "${quotes_cache_file}" | shuf -n1 --random-source=/dev/urandom;