3 ms·
Let's have a more concrete example of ambiguity. "${*##*[ ]}" is a valid POSIX approach to getting the last parameter but it doesn't work in ksh or bash. Thos
by chasil 4y ago
Let's have a more concrete example of ambiguity.
"${*##*[ ]}" is a valid POSIX approach to getting the last parameter but it doesn't work in ksh or bash. Those shells apply the pattern to each parameter in turn when used on '*' or '@'.
That text is from a developer who has profound depth.
A portable method to extract the last argument is:
for last
do :
done
This ambiguity and subtlety is not good.