Skip to content

Instantly share code, notes, and snippets.

@adamluzsi
Created March 16, 2019 21:59
Show Gist options
  • Save adamluzsi/2d546c0a0624ecd0e99415fd4d185dc8 to your computer and use it in GitHub Desktop.
Save adamluzsi/2d546c0a0624ecd0e99415fd4d185dc8 to your computer and use it in GitHub Desktop.
bash behavior for command evaluation in func
## 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