The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #6 (permalink)  
Old 10-03-2006
BOFH BOFH is offline Forum Advisor  
Registered User
  
 

Join Date: Feb 2005
Location: Broomfield, CO
Posts: 406
The numeric comparisons for korn shell are

numA -eq numB - True if numA and numB are equal
numA -ne numB - True if numA and numB are not equal
numA -lt numB - True if numA is less than numB
numA -gt numB - True if numA is greater than numB
numA -le numB - True if numA is less than or equal to numB
numA -ge numB - True if numA is greater than or equal to numB

the string comparisons for korn shell are

strA = strB - True if strA matches strB
strA != strB - True if strA does not match strB
strA < strB - True if strA comes before strB in a dictionary order
strA > strB - True if strA comes after strB in a dictionary order

So your example says to run the commands between then and fi or else if the return code of the previous command is equal to zero (0).

Carl