ansible-coreos-bootstrap
ansible-coreos-bootstrap copied to clipboard
Add the magic back: $@ -> "$@"
In bash "$@" is magic (expand arguments while preserving their boundaries). $@ is equivalent to $* and "$*" is "interpolate all arguments into a single string, separated by the first character of the $IFS value.
Properly wrapping a command and preserving any arguments as they were quoted/escaped on the command line requires "$@" ... the "magic" form of this variable.
So I am always so hesitant to change anything in this repo mostly because it doesn't have tests and I can never be sure what the latest ongoings with coreos and ansible are (I use neither anymore). Would it be possible to add some sort of tests that can be run for this stuff or even instructions to the wiki to do so? Then I would feel better about merging in stuff.
Roman,
Okay, I'll look at a little test suite.
I can easily write a test showing the failure mode when you don't have "$@" which, of course, will pass with it.
Basically if you call runner.sh with a argument list like: this "that other thing" ... then the $@ will treat that as 4 arguments while "$@" will have 2 arguments: $1 : this and $2: that other thing
But I'll have to see how your test harness works to figure out where to put such a test and how to capture/evaluate the results.
On Thu, Aug 25, 2016 at 9:44 AM, Roman Shtylman [email protected] wrote:
So I am always so hesitant to change anything in this repo mostly because it doesn't have tests and I can never be sure what the latest ongoings with coreos and ansible are (I use neither anymore). Would it be possible to add some sort of tests that can be run for this stuff or even instructions to the wiki to do so? Then I would feel better about merging in stuff.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/defunctzombie/ansible-coreos-bootstrap/pull/34#issuecomment-242458334, or mute the thread https://github.com/notifications/unsubscribe-auth/ADoGFsy8bAVgMOKJgCGopBhF0ngA1QN0ks5qjcZygaJpZM4JsfQ0 .