"$@"
expands to one "word" per script argument, which means that it will expand to nothing if there are no script arguments. On the other hand, "$BASH_ARGV"
expands to the first value in the array $BASH_ARGV
if that array exists and otherwise empty. So I'm not sure what you actually want to compare.
But the main point is that "$@"
expands to zero or more words. If it doesn't expand to a single word, then your expression is going to be syntactically incorrect. (Probably. It's possible that the entire set of arguments happens to be a valid expression.)
If you wanted to concatenate all the arguments together, you should use "$*"
. But that's still not comparable to "$BASH_ARGV"
. It's not really comparable to "${BASH_ARGV[*]}"
either, but the latter would be somewhat more similar.
You might want to check out BASH_ARGC
, too.