Thursday, March 22, 2012

UNIX TOOLS - String compare in Shell Script

For string Comparisons use
OperatorMeaning
string1 = string2string1 is equal to string2
string1 != string2 string1 is NOT equal to string2
string1 string1 is NOT NULL or not defined 
-n string1 string1 is NOT NULL and does exist
-z string1 string1 is NULL and does exist

No comments:

Post a Comment