Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • 2
    In older versions of bash, $RANDOM (initially a ksh feature) randomness was notoriously very bad and hardly usable. Commented Jul 21, 2021 at 19:37
  • Previously the random function was located in variables.c, made according to Park and Miller (1988). Bash 5.1 introduced SRANDOM (cryptographic-grade /dev or arc4, LC fallback) and got a new RNG for RANDOM (same one, but better folding to 16-bit); code for both is in lib/sh/random.c. Commented Aug 15, 2024 at 3:36