next up previous contents
Next: Vector and String Subscription Up: Dollar Bracket Expressions Previous: Comparison Operators   Contents

Conditional Expansion

The operator in table 5 allow conditional expansion. The ${? }-operator constitutes a if-then statement. If arg0, usually the result of a comparison operation, is equal to 1 than arg1 is returned - otherwise arg2. The ${?? }-operator allows to choose from a list of arguments. If arg0 is '1' than arg1 is returned, if it is '2' than arg2 is returned, etc.

Table 5: Conditional expansion.
${? arg0 arg1 arg2} if-then
${?? arg0 arg1 arg2 ...} choice

Frank-Rene Schaefer 2002-09-14