From 18dfefdec56bc208dd7698d294de8405d116b8f3 Mon Sep 17 00:00:00 2001 From: axtloss <60044824+axtloss@users.noreply.github.com> Date: Sat, 24 Apr 2021 11:42:19 +0200 Subject: fixed an issue, where you could specify a number higher than the count of numbers --- nofetch | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nofetch b/nofetch index 0dc22b3..ada19fe 100755 --- a/nofetch +++ b/nofetch @@ -4,7 +4,12 @@ if [[ $1 == "" ]]; then rng=$((1 + $RANDOM % 11 )) else - rng=$1 + if [[ $1 -lt 11 ]]; + then + rng=$1 + else + rng=$((1 + $RANDOM % 11 )) + fi fi if [ $rng -eq 1 ] -- cgit v1.2.3