Files
mastering-unix-ss/chapter11/function_in_range_random_number
Fabio Scotto di Santolo 4cc88d2f6e initial commit
2020-07-28 19:28:25 +02:00

11 lines
209 B
Plaintext
Executable File

function in_range_random_number
{
# Create a pseudo-random number less than or equal
# to the $UPPER_LIMIT value, which is user defined
RANDOM_NUMBER=$(($RANDOM % $UPPER_LIMIT + 1))
echo "$RANDOM_NUMBER"
}