UNIX for OpenVMS Users, Second Edition

We have seen that the C shell set command associates a value to a variable and that such values may be integers or text: for example, set a = 1 or set a = "test". The Korn shell surrounds an arithmetic operation with double parentheses: (( a = 1 )). OpenVMS uses = to equate a variable to an integer value and := or =" " to equate a variable to a string value. The OpenVMS user can perform mathematical operations on either string or integer values. The UNIX C shell permits only mathematical operations on integer variables, whereas the Korn shell will permit arithmetic on string variables if the value of the variable equates to an integer. The C shell @ metacharacter equates a variable name to the result of a mathematical operation using integer variables. Table 10-6 lists mathematical operators used by the shells.
| C Shell Operator | Korn Shell Operator | OpenVMS Equivalent | UNIX Meaning |
|---|---|---|---|
| -a | * | True if object is any kind of file | |
| -b | True if file is a block special file | ||
| -c | True if file is a character special file | ||
| -d | -d | True if file is a directory | |
| -e | -e | * | True if file exists |
| -f | -f | True if file is a regular file | |
| -g | True if file has its setgid bit set | ||
| -G | F$GETJPI() | True if file's group matches group... |