randpick - return pseudo-random value of a variable

SYNOPSIS

<randpick $var>


DESCRIPTION
The randpick function returns a single pseudo-randomly-selected value of $var, as a string, or zero values on error (e.g. OpenSSL library could not be loaded). The selection utilizes rand (here).


DIAGNOSTICS
The randpick function returns a single pseudo-randomly-selected value of $var, as a string, or zero values on error. Returning zero values on error was added in version 8.01.1773857975 20260318.


EXAMPLE

<$colors = red orange yellow green blue violet>
<randpick $colors>
Roses are $ret.

The output might be:

Roses are green.


CAVEATS
The randpick function was added Nov. 7 1996.


SEE ALSO
rand, srand


Copyright © Thunderstone Software     Last updated: Tue Nov 3 02:33:21 PM EST 2026
Copyright © 2026 Thunderstone Software LLC. All rights reserved.