Last active
November 9, 2020 20:43
-
-
Save DarwinAwardWinner/8a631d897d45f005528a to your computer and use it in GitHub Desktop.
Put bash cluster setup code and python script in a single file
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 | |
# -*- mode:python -*- | |
#PBS -l nodes=1:ppn=8,mem=30gb | |
''''/bin/true | |
# This is bash code to set up the environment | |
echo "Hello from bash!" | |
echo "Args are: $@" | |
# Bash setup code ends here | |
python - "$@" <<EOF | |
''' # Python starts here ''' | |
print "Hello from Python!" | |
import sys | |
print "Args are:", sys.argv[1:] | |
# End Python code | |
EOF = None | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment