setting shell variables directly is more verbose
This commit is contained in:
Martin Diehl 2021-04-22 08:04:46 +02:00
parent 74dd9bf589
commit 0773fb5fae
3 changed files with 0 additions and 29 deletions

5
env/CONFIG vendored
View File

@ -1,5 +0,0 @@
# "set"-syntax needed only for tcsh (but works with bash and zsh)
set OMP_NUM_THREADS = 4
set MSC_ROOT = /opt/msc
set MSC_VERSION = 2020

11
env/DAMASK.sh vendored
View File

@ -19,17 +19,9 @@ fi
DAMASK_ROOT=$(canonicalPath "$ENV_ROOT/../")
# shorthand command to change to DAMASK_ROOT directory
eval "function DAMASK_root() { cd $DAMASK_ROOT; }"
# defining set() allows to source the same file for tcsh and bash, with and without space around =
set() {
export $1$2$3
}
source $ENV_ROOT/CONFIG
unset -f set
# add BRANCH if DAMASK_ROOT is a git repository
cd $DAMASK_ROOT >/dev/null; BRANCH=$(git branch 2>/dev/null| grep -E '^\* '); cd - >/dev/null
@ -86,9 +78,6 @@ if [ ! -z "$PS1" ]; then
echo
fi
export OMP_NUM_THREADS
export MSC_ROOT
export MSC_VERSION
export DAMASK_ROOT
export PYTHONPATH=$DAMASK_ROOT/python:$PYTHONPATH

13
env/DAMASK.zsh vendored
View File

@ -12,16 +12,6 @@ function blink {
ENV_ROOT=$(canonicalPath "${0:a:h}")
DAMASK_ROOT=$(canonicalPath "${0:a:h}'/..")
# shorthand command to change to DAMASK_ROOT directory
eval "function DAMASK_root() { cd $DAMASK_ROOT; }"
# defining set() allows to source the same file for tcsh and zsh, with and without space around =
set() {
export $1$2$3
}
source $ENV_ROOT/CONFIG
unset -f set
# add BRANCH if DAMASK_ROOT is a git repository
cd $DAMASK_ROOT >/dev/null; BRANCH=$(git branch 2>/dev/null| grep -E '^\* '); cd - >/dev/null
@ -80,9 +70,6 @@ if [ ! -z "$PS1" ]; then
echo
fi
export OMP_NUM_THREADS
export MSC_ROOT
export MSC_VERSION
export DAMASK_ROOT
export PYTHONPATH=$DAMASK_ROOT/python:$PYTHONPATH