What is the most idiomatic way in Bash to test if no positional parameters are given? There are so many ways to check this, I wonder if there is one preferred way.
S
I prefer using the fact that if there are no positional parameters, there is also no first parameter:
[[ -z $1 ]] test -z "$1" [ -z "$1" ]
It's just a tiny bit lighter on the reader. Of course it only works when the assumption that the first parameter can't be an empty string is true.