Show HN: Bash-my-AWS adds `bmai ` to generate functions
github.com
Show HN: Bash-my-AWS adds `bmai ` to generate functions
1–4 of 4 posts
Re: Show HN: Bash-my-AWS adds `bmai <missing command>` to generate functions
#2Have they not heard of shellcheck?
Re: Show HN: Bash-my-AWS adds `bmai <missing command>` to generate functions
#3Surely a repo dedicated to bash would know not to use $@ without its quotes :-( https://github.com/bash-my-aws/bash-my-aws/blob/e5cdae316084... Have they not heard of shellcheck?
__bma_read_filters "arg1 arg2" arg3
With unquoted $@:
• Gets word split into: arg1 arg2 arg3 • Results in: arg1|arg2|arg3
With quoted "$@":
• Would be passed as: "arg1 arg2" arg3 • Results in: "arg1 arg2"|arg3
The unquoted version is correct here since the function is intentionally using word splitting to create individual grep pattern elements.
This is one of those cases where the normal "always quote your variables" rule has a valid exception because word splitting is part of the intended behavior.