27.08.2015 Views

Advanced Bash−Scripting Guide

Advanced Bash-Scripting Guide - Nicku.org

Advanced Bash-Scripting Guide - Nicku.org

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

7.3. Comparison operators (binary)<br />

integer comparison<br />

−eq<br />

is equal to<br />

<strong>Advanced</strong> <strong>Bash−Scripting</strong> <strong>Guide</strong><br />

−ne<br />

−gt<br />

−ge<br />

−lt<br />

−le<br />

<<br />

<br />

>=<br />

if [ "$a" −eq "$b" ]<br />

is not equal to<br />

if [ "$a" −ne "$b" ]<br />

is greater than<br />

if ["$a" −gt "$b" ]<br />

is greater than or equal to<br />

if [ "$a" −ge "$b" ]<br />

is less than<br />

if [ "$a" −lt "$b" ]<br />

is less than or equal to<br />

if [ "$a" −le "$b" ]<br />

is less than (within double parentheses)<br />

(("$a" < "$b"))<br />

is less than or equal to (within double parentheses)<br />

(("$a" "$b"))<br />

is greater than or equal to (within double parentheses)<br />

(("$a" >= "$b"))<br />

string comparison<br />

=<br />

Chapter 7. Tests 49

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!