Created
March 16, 2019 21:59
-
-
Save adamluzsi/2d546c0a0624ecd0e99415fd4d185dc8 to your computer and use it in GitHub Desktop.
bash behavior for command evaluation in func
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## I expect this to fail when string passed as first argument | |
"bash -i -c 'echo hello world'" | |
#>bash: bash -i -c 'echo hello world': command not found... | |
## I expect this to fail when string " is around ${@}, but well... | |
$ function asdf() { "${@}"; } | |
$ asdf bash -i -c 'echo hello world' | |
#>hello world | |
## I expect an empty string value | |
$ : ${x:=""} | |
#> x == "" | |
## I expect an empty string value as well, but... | |
$ : ${y:=''} | |
#> x== "''" or in other words, two literal ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment