News for hackers. Stuff that matters.
Re:Random Numbers in Bash by patrakov on Monday March 27, 2023 @03:06PM (#35330920)
Another fun fact: on Linux systems, the /proc/sys/kernel/random/uuid file contains a random UUID. This can be used to get 32-bit random numbers in POSIX shell without calling out to external utilities. Quite handy on OpenWrt.

read -r < /proc/sys/kernel/random/uuid

MYRAND=$(( 0x${REPLY%%-*} ))

There are no comments on this comment yet.