Last active
September 24, 2020 22:51
-
-
Save joemiller/5d400a76fde1ab4d497c22b6fa6d9dee to your computer and use it in GitHub Desktop.
demo of bash vars global scope by default
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
foo() { | |
op=$1 | |
# local op=$1 | |
echo "foo: op is $op" | |
} | |
main() { | |
op="main" | |
echo "main: $op" | |
foo "bar" | |
echo "main: $op" | |
} | |
main "$@" |
Author
joemiller
commented
Sep 24, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment