Wednesday, July 31, 2013

Operators in Bash script

1 String comparison operators

(1) s1 = s2
(2) s1 != s2
(3) s1 < s2
(4) s1 > s2
(5) -n s1
(6) -z s1

(1) s1 matches s2
(2) s1 does not match s2
(3) __TO-DO__
(4) __TO-DO__
(5) s1 is not null (contains one or more characters)
(6) s1 is null

2 Arithmetic operators

+
-
*
/
% (remainder)

3 Arithmetic relational operators

-lt (<)
-gt (>)
-le (<=)
-ge (>=)
-eq (==)
-ne (!=)

No comments:

Post a Comment