-
-
Save keenhenry/1408bb762fe2a4610b0967effd037fb5 to your computer and use it in GitHub Desktop.
Embed Python in a bash script
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 | |
export FOO=100 | |
python - <<END | |
import os | |
print "foo:", os.environ['FOO'] | |
END | |
BAR=200 python - <<END | |
import os | |
print "bar:", os.environ['BAR'] | |
END | |
# output: | |
# foo: 100 | |
# bar: 200 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment