Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

bash if larger than

# In bash, you should do your check in arithmetic context:

if (( a > b )); then
    ...
fi

# For POSIX shells that don't support (()), you can use -lt and -gt.

if [ "$a" -gt "$b" ]; then
    ...
fi
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #bash #larger
ADD COMMENT
Topic
Name
5+2 =