Skip to content

Instantly share code, notes, and snippets.

View andrewcrook's full-sized avatar

andrewcrook

  • UK
View GitHub Profile
@andrewcrook
andrewcrook / .bashrc
Created January 7, 2023 15:25 — forked from jaantollander/.bashrc
Adding to PATH in idempotent way, that is, without repetition.
# https://unix.stackexchange.com/a/124447
add_to_path() {
case ":${PATH:=$1}:" in *:"$1":*) ;; *) PATH="$1:$PATH" ;; esac;
}
# Example
add_to_path $HOME/bin/julia-1.6.1/bin