Article 6N95X is it a bug in bash? [[ and "$@"

is it a bug in bash? [[ and "$@"

by
pan64
from LinuxQuestions.org on (#6N95X)
Is it a bug, undocumented or just inconsistent? $@ evaluation in [[ ]]:

Code:a=(asdfa = asdf)
[[ "${a[@]}" ]]
0

[[ "${a[@]}" =~ fg ]]
1

[[ "${a[@]}" =~ fa ]]
0

test "${a[@]}"
1

test "${a[@]}" =~ fa
bash: test: too many arguments

[ "${a[@]}" ]
1Anyway, it looks like zsh works the same way, it is intentional.
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments