@BinaryZebra - there is nothing obfuscated about simple ANSI C math. But your thing affects the return - and so influences the caller's environment.
That's not necessarily bad - if the function is meant to return false for a no argument condition then ok - but it needs to be expected. In general I wouldn't expect it: ${notset} is not false, and set --; echo "$1" is not false, for example. Your thing also goes pretty haywire for an $IFS of digits.
user2350426
22:51
@JeffSchaller Ooops, sorry, I meant: [ $# -gt 0 ] && shift "$((${#}-1))"; printf %s\\n "$1" which is safer to execute calling a function to preserve the present arguments.
@BinaryZebra - that would cool. i was mainly asking because i dont have a netbsd and was curious about what would or wouldnt work in its arithmetic expressions.
still, in my opinion, eval ought to be preferred for these things - it is much more simple under the hood just to index the last argument than to copy the whole array, shift most of it away, and then to print it.