Programming and posix - April 2002
April 3, 2002
Solution Symposium
Page 81
hp e3000
programming
and posix
posix shell test command
• test expression or [ expression ]
• exit status indicates the result of the expression:
• 0 - true
• 1 - false
• 2 - expression syntax error
• -f file - true if the file exists
• -d file - true if the file is a directory
• string1 = string2 - true if strings are identical
• number1 -eq number2 - true if numbers are equal
• expr1 -a expr2 - AND relationship
• expr1 -o expr2 - OR relationship
• and many more...