Hello,
I am trying to add some tests to existing code. The code already contains some test commands. An example is as follows...
[[ ${retCode} == 2 ]] then
Does anyone know the purpose of the double equals? I would have used a single equals sign...
Hello,
I am trying to add some tests to existing code. The code already contains some test commands. An example is as follows...
[[ ${retCode} == 2 ]] then
Does anyone know the purpose of the double equals? I would have used a single equals sign...
Barry Rosenberg ("Hands-On KornShell93 Programming", Addison-Wesley, 1998) says (p76, Table 6-2):
I hope this clears things up.
Interestingly the man page for test in AIX 5.3 doesn't refer to any of the string operators.
bakunin
The double-equal is the correct syntax for ksh93, although it will tolerate the single-equal to be backward-compatable with ksh88. In ksh88 (the default AIX shell) the single-equal is correct, but the double-equal is sometimes tolerated. By "sometimes" I mean the currently supported AIX versions. I don't believe it will work with ksh under AIX43 (or even AIX51) but these have both been out of support for some time.