FMeinicke's Wiki

Home

❯

Linux

❯

Shells

❯

bash

❯

General

❯

Get a random integer value

Get a random integer value

May 26, 20251 min read

  • bash/random

random

Source

  • https://serverfault.com/a/1076250/600279
START=5
LIMIT=42
echo $(( $START + $RANDOM % $LIMIT))

prints a random integer between 5 and 42


Graph View

Created with Quartz v4.5.0 © 2025

  • GitHub