Skip to content

Instantly share code, notes, and snippets.

@jld
Created March 8, 2016 01:51
Show Gist options
  • Select an option

  • Save jld/e08e3ffb0bd0cb0a9ec9 to your computer and use it in GitHub Desktop.

Select an option

Save jld/e08e3ffb0bd0cb0a9ec9 to your computer and use it in GitHub Desktop.
$ set -- foo bar
$ for x in "$@ X"; do echo $x; done
foo
bar X
$ X=X
$ for x in "$@ $X"; do echo $x; done
foo
bar X
sh-3.2$ set -- foo bar
sh-3.2$ for x in "$@ X"; do echo $x; done
foo
bar X
sh-3.2$ X=X
sh-3.2$ for x in "$@ $X"; do echo $x; done
foo bar X
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment