Last active
August 29, 2015 14:24
-
-
Save mattintosh4/7fd4719488c03b290d3f to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| bash -c 'declare -p VAR' | |
| VAR=1 bash -c 'declare -p VAR' | |
| bash -c 'declare -p VAR' |
This file contains hidden or 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
| bash: line 0: declare: VAR: not found | |
| declare -x VAR="1" | |
| bash: line 0: declare: VAR: not found |
This file contains hidden or 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
| $ CC=gcc CXX=g++ ./configure |
This file contains hidden or 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
| $ set | grep ^LANG= | |
| LANG=en_US.UTF-8 | |
| $ LANG=C set | grep ^LANG= | |
| LANG=en_US.UTF-8 | |
| $ (LANG=C; set) | grep ^LANG= | |
| LANG=C |
This file contains hidden or 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
| $ LANG=C bash -c 'declare -p LANG' | |
| declare -x LANG="C" | |
| $ python -c 'import subprocess; subprocess.call(["LANG=C", "bash", "-c", "declare -p LANG"])' | |
| Traceback (most recent call last): | |
| File "<string>", line 1, in <module> | |
| File "/usr/lib/python2.7/subprocess.py", line 522, in call | |
| return Popen(*popenargs, **kwargs).wait() | |
| File "/usr/lib/python2.7/subprocess.py", line 710, in __init__ | |
| errread, errwrite) | |
| File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child | |
| raise child_exception | |
| OSError: [Errno 2] No such file or directory |
This file contains hidden or 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
| $ env LANG=C bash -c 'declare -p LANG' | |
| declare -x LANG="C" | |
| $ python -c 'import subprocess; subprocess.call(["env", "LANG=C", "bash", "-c", "declare -p LANG"])' | |
| declare -x LANG="C" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment