Skip to content

Instantly share code, notes, and snippets.

@SamirTalwar
Created October 30, 2015 15:55
Show Gist options
  • Select an option

  • Save SamirTalwar/e8bdbc024df7bf2dd6ea to your computer and use it in GitHub Desktop.

Select an option

Save SamirTalwar/e8bdbc024df7bf2dd6ea to your computer and use it in GitHub Desktop.
So both `export` and `local` swallow failure in both Bash and zsh.
$ foo=$(false); echo $?
1
$ export foo=$(false); echo $?
0
$ function bar { local foo=$(false); echo $?; }; bar
0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment