This is an old revision of the document!


Control and comparison

大于 -gt (greater than)
小于 -lt (less than)
大于或等于 -ge (greater than or equal)
小于或等于 -le (less than or equal)
不相等 -ne (not equal)

if (( $(echo "$num1 > $num2" |bc -l) )); then
  …
fi

############### and

if [ c1 -a c2 ]; then
…
fi

if [ c1 ] && [ c2 ]; then
…
fi

############## or

if [ c1 -o c2 ]; then
…
fi

if [ c1 ] || [  c2 ]; then
…
fi


multiline comments in Bash

: '
This is a
very neat comment
in bash
'