From: Armaan Bhojwani Date: Tue, 6 Apr 2021 14:04:07 +0000 (-0400) Subject: fortune: make seed POSIX compliant X-Git-Tag: v0.0.1~6 X-Git-Url: https://git.armaanb.net/?p=bin.git;a=commitdiff_plain;h=ee45620fbb606b6fc57c5782202514f0260541c5 fortune: make seed POSIX compliant --- diff --git a/fortune b/fortune index cbf1984..fde9085 100755 --- a/fortune +++ b/fortune @@ -89,7 +89,7 @@ $1 == "%" { } END { - "date +%N" | getline time - srand(time) + "od -A n -t d -N 3 /dev/urandom" | getline seed + srand(seed) print fortunes[int(rand() * (f - 2)) + 1] }' $FILE