Created
October 24, 2017 15:41
-
-
Save dpshelio/f40e462bfc4533d0c8c8b0a2cccf8aae to your computer and use it in GitHub Desktop.
bits I have in my bash/zshrc files
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
function conda_up () { | |
# This function (conda_up) will activate anaconda in your path - to deactivate run conda_down | |
CONDA_PATH=/opt/anaconda/bin | |
if [[ ":$PATH:" != *":$CONDA_PATH:"* ]]; then | |
PATH=$CONDA_PATH:$PATH; | |
fi | |
} | |
function conda_down () { | |
# Remove conda from the path | |
# from: http://stackoverflow.com/a/370192/1087595 | |
export PATH=`echo ${PATH} | awk -v RS=: -v ORS=: '/anaconda/ {next} {print}'` | |
} | |
function sac () { | |
# This function is to activate different environments in your conda instalation. | |
# Look at https://conda.io/docs/using/envs.html to learn more about conda environments | |
# You can do `conda env list` to see all the conda environments. | |
conda_up | |
source activate $1 | |
} | |
alias sd='source deactivate' # alias to deactivate the environemnt and go back to the default conda environment (root) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment