Skip to content

Instantly share code, notes, and snippets.

@sjmcgrath
Created October 5, 2018 18:05
Show Gist options
  • Save sjmcgrath/8d670d4ab1303327652d28c2dd65a610 to your computer and use it in GitHub Desktop.
Save sjmcgrath/8d670d4ab1303327652d28c2dd65a610 to your computer and use it in GitHub Desktop.
Bash Lessons: Subshells vs Lists
$ foo=1
$
$ # subshell
$ (
> foo=2
> )
$ echo $foo
1
$ # not a subshell
$ {
> foo=2
> }
$ echo $foo
2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment