From 8747708136ebe95868562926bfb377d91cd01fe8 Mon Sep 17 00:00:00 2001 From: DJCrashdummy Date: Mon, 3 Aug 2020 14:31:11 +0200 Subject: [PATCH] bash: Correct mistakes at $RANDOM (#1147) - using `=` just throws an error! - `200` limits the result to 200 possible numbers starting with 0! so the maximum is 199. - added `$` straight before `RANDOM` to be on the safe side. --- bash.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash.md b/bash.md index 73e0b1abf..9452dba9e 100644 --- a/bash.md +++ b/bash.md @@ -623,7 +623,7 @@ $((a + 200)) # Add 200 to $a ``` ```bash -$((RANDOM%=200)) # Random number 0..200 +$(($RANDOM%200)) # Random number 0..199 ``` ### Subshells