MPE/iX Shell and Utilities Reference Manual, Vol 2
sh(1) MPE/iX Shell and Utilities sh(1)
${parameter–word}
is similar to the preceding construct, except that the parameter is expanded if defined,
even if the value is empty.
${variable:=word}
expands word with parameter expansion and assigns the result to variable, provided
that variable is not defined or has an empty value. The result is the expansion of
variable, whether or not word was expanded.
${variable=word}
is similar to the preceding construct, except that the variable must be undefined (it
can’t just be null) for word to be expanded.
${parameter:?word}
expands to the value of parameter provided that it is defined and non-empty. If
parameter isn’t defined or is null, sh expands and displays word as a message. If
word is empty, sh displays a default message. Once a non-interactive shell has
displayed a message, it terminates.
${parameter?word}
is similar to the preceding construct, except that sh displays word only if parameter
is undefined.
${parameter:+word}
expands to word, provided that parameter is defined and non-empty.
${parameter+word}
expands to word, provided that parameter is defined.
${parameter#pattern}
attempts to match pattern against the value of the specified parameter. The pattern is
the same as a case pattern. sh search for the shortest prefix of the value of parame-
ter that matches pattern.Ifsh finds no match, the previous construct expands to the
value of parameter; otherwise, the portion of the value that matched pattern is
deleted from the expansion.
${parameter##pattern}
is similar to the preceding construct, except that sh deletes the longest part that
matches pattern if it finds such a match.
${parameter%pattern}
searches for the shortest suffix of the value of parameter matching pattern and
deletes the matching string from the expansion.
1-532 Commands and Utilities