Last active
April 4, 2017 23:10
-
-
Save chrischoy/08c113588f2532c81ac29b8c6b195c89 to your computer and use it in GitHub Desktop.
Activate
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/sh | |
SERVER=$1 | |
ENVNAME=$2 | |
ENV_ROOT="/cvgl/u/chrischoy/.pyv/${SERVER}/${ENVNAME}/bin" | |
# Check the number of arguments | |
if [ "$#" -eq 2 ] && [ -d "${ENV_ROOT}" ]; then | |
export OLD_LD_LIBRARY_PATH=$LD_LIBRARY_PATH | |
export OLD_PATH=$PATH | |
export OLD_PS1="$PS1" | |
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH | |
export PATH=/cvgl/u/chrischoy/.pyv/${SERVER}/${ENVNAME}/bin:/usr/local/cuda/bin:$PATH | |
export PS1="(${SERVER}:${ENVNAME})$PS1" | |
else | |
echo "Please put the server name and environment name as arguments, you put ${1} and ${2}" >&2 | |
fi |
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
export LD_LIBRARY_PATH=$OLD_LD_LIBRARY_PATH | |
export PATH=$OLD_PATH | |
export PS1=$OLD_PS1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment