Skip to content

Instantly share code, notes, and snippets.

@supki
Created April 2, 2014 06:18
Show Gist options
  • Save supki/9928819 to your computer and use it in GitHub Desktop.
Save supki/9928819 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -o errexit
fun-global ()
{
FOO=$(exit 1)
echo "fun-global: this won't be printed"
}
fun-local ()
{
local BAR=$(exit 1)
echo "fun-local: this *will* be printed"
}
fun-global || fun-local
# % ./eblo.sh
# fun-global: this won't be printed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment