Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

bash check if number is greater than

# bash check if number is greater than
a=10
b=11

if [ $a -gt $b ]; then
	echo "this is won't be executed, because $a is smaller than $b";
fi

# DON'T DO THIS:
if [ $a > $b ]; then 		#INCORRECT!!
	echo "this will be executed, incorrectly";
fi
 
PREVIOUS NEXT
Tagged: #bash #check #number #greater
ADD COMMENT
Topic
Name
5+5 =