Bash random: Revision history

From wikinotes

Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
Legend: (cur) = difference with latest revision, (prev) = difference with preceding revision, m = minor edit.

11 December 2022

  • curprev 16:5216:52, 11 December 2022Will talk contribs 339 bytes +339 Created page with " = $RANDOM envvar = <blockquote> The RANDOM environment variable returns a random number between 0 and 32767.<br> You can use modulus to use it to generate a random number within a range. <syntaxhighlight lang="bash"> echo $(($RANDOM % 6 + 3)) # pick a number between 3 and 9 (6+3) </syntaxhighlight> </blockquote><!-- $RANDOM envvar -->"