Skip to content

Instantly share code, notes, and snippets.

@azat
Last active August 29, 2015 14:21
Show Gist options
  • Save azat/c0467706787cdcc03a51 to your computer and use it in GitHub Desktop.
Save azat/c0467706787cdcc03a51 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html
set -e
function foo()
{
if [ 1 = 2 ]; then
true
elif [ 1 = 3 ]; then
true
else
false
echo false
fi
}
function run()
{
if ! $@; then
echo nope
else
echo yep
fi
}
function main()
{
run foo
echo but
foo
}
main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment