
k
ksh(1) | ksh(1) |
(" "), parameter and command substitution occurs and \ quotes the characters \, Á, ", and $. $* and $@ have identical meanings when not quoted or when used as a parameter assignment value or as a ®le name. However, when used as a command argument, "$*" is equivalent to "$1d $2d ...", where d is the ®rst character of the IFS parameter, whereas "$@" is equivalent to "$1" "$2" ... . Inside back single quote (accent grave) marks (Á Á) \ quotes the characters \, Á, and $. If the back single quotes occur within double quotes, \ also quotes the character ".
The special meaning of keywords or aliases can be removed by quoting any character of the keyword. The recognition of function names or special command names listed below cannot be altered by quoting them.
Arithmetic Evaluation
The ability to perform integer arithmetic is provided with the special command let. Evaluations are performed using long arithmetic. Constants take the form [ base# ]n, where base is a decimal number between two and
An arithmetic expression uses the same syntax, precedence, and associativity of expression of the C language. All the integral operators, other than ++, -
An internal integer representation of a variable can be speci®ed with the
Since many of the arithmetic operators require quoting, an alternative form of the let command is pro- vided. For any command beginning with ((, all characters until the matching )) are treated as a quoted expression. More precisely, ((...)) is equivalent to let " ...".
Prompting
When used interactively, the shell prompts with the value of PS1 before reading a command. If at any time a
Conditional Expressions.
A conditional expression is used with the [[ compound command to test attributes of ®les and to compare strings. Word splitting and ®le name generation are not performed on the words between [[ and ]]. Each expression can be constructed from one or more of the following unary or binary expressions:
file1
Section 1−402
True if ®le exists.
True if ®le exists and is a block special ®le. True if ®le exists and is a character special ®le. True if ®le exists and is a directory.
True if ®le exists and is an ordinary ®le. True if ®le exists and is has its setgid bit set. True if ®le exists and is a a symbolic link. True if ®le exists and is has its sticky bit set. True if length of string is
True if option named option is on.
True if ®le exists and is a ®fo special ®le or a pipe. True if ®le exists and is readable by current process. True if ®le exists and has size greater than zero.
True if ®le descriptor number ®ldes is open and associated with a terminal dev- ice.
True if ®le exists and is has its setuid bit set.
True if ®le exists and is writable by current process.
True if ®le exists and is executable by current process. If ®le exists and is a directory, the current process has permission to search in the directory.
True if length of string is zero.
True if ®le exists and its group matches the effective group ID of this process. True if ®le exists and is a socket.
True if ®le1 exists and is newer than ®le2.
− 7 − |