commit a6081809f889144dba9ca546bc25342d1afd7457 parent d9360c46d49f031bf15db2a09c84fece4462a136 Author: Anders Damsgaard <anders@adamsgaard.dk> Date: Thu, 7 May 2020 12:30:11 +0200 Add pism path and PATH helper function Diffstat:
M | .profile | | | 18 | +++++++++++------- |
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/.profile b/.profile @@ -1,4 +1,3 @@ -PATH=$HOME/.local/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/games:$PATH MANPATH=/usr/local/share/man:$MANPATH export LANG=en_US.UTF-8 @@ -175,12 +174,17 @@ alias or='plumb "$(randomfile)"' alias julia-fast='julia --procs 1 --optimize=3 --math-mode=fast' -if [ -d "/usr/local/cuda/bin" ]; then - PATH=/usr/local/cuda/bin:$PATH - if [ -d "/usr/local/gcc-8.3.0/bin" ]; then - PATH=/usr/local/gcc-8.3.0/bin:$PATH - fi -fi +addtopath() { + for d in "$@"; do + if [ -d "$d" ]; then + PATH="${d}:${PATH}" + fi + done +} + +addtopath /usr/local/cuda/bin /usr/local/gcc-8.3.0/bin +addtopath ~/code/pism-stable-install/bin +addtopath ~/.local/bin ENV=$HOME/.kshrc export PATH HOME TERM ENV MANPATH