Conditional Structures
Intro
#!/bin/bash
number=$RANDOM
echo -n "Type a number" # -n doesn't jump, stays in the same line
read player
if test $number -eq $player
then
echo "Congrats!"
elif test $number -gt $player
then
echo "Your number is lower"
else
echo "Your number is greater"
fi
echo "the number of player is $player"
echo "the random number is $number"Controlling inputs
Menus -> Case
Last updated