random int

For random.

Generate a random integer [min..max].

Command Type

built-in

Signature

> random int {flags} (range)

Parameters

  • range: Range of potential values, inclusive of both start and end values.

Input/output types:

input output
nothing int

Examples

Generate a non-negative random integer.

> random int

Generate a random integer between 0 (inclusive) and 500 (inclusive).

> random int ..500

Generate a random integer greater than or equal to 100000.

> random int 100000..

Generate a random integer between -10 (inclusive) and 10 (inclusive).

> random int (-10)..10

Ported from nushell/nushell.github.io. Copyright (c) 2021 Nushell Project. MIT License.