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:
parent
663ddd5ab1
commit
0fcb2b592f
1 changed files with 2 additions and 2 deletions
|
@ -7,7 +7,7 @@ if [[ "$#" -lt "1" ]]; then
|
||||||
echo -e "Quote generation tool"
|
echo -e "Quote generation tool"
|
||||||
echo -e "By Starbeamrainbowlabs"
|
echo -e "By Starbeamrainbowlabs"
|
||||||
echo -e ""
|
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 ""
|
||||||
echo -e "Usage:"
|
echo -e "Usage:"
|
||||||
echo -e " quote-get {quote-file-url}"
|
echo -e " quote-get {quote-file-url}"
|
||||||
|
@ -47,4 +47,4 @@ RANDOM=$(date +%Y%m%d);
|
||||||
|
|
||||||
quote_line=$((( $RANDOM % ${quote_count} )));
|
quote_line=$((( $RANDOM % ${quote_count} )));
|
||||||
|
|
||||||
sed -n ${quote_line}p "${quotes_cache_file}";
|
cat "${quotes_cache_file}" | shuf -n1 --random-source=/dev/urandom;
|
||||||
|
|
Loading…
Reference in a new issue