PATH="${PATH:-/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games}" for dir in \ "/usr/games" \ "/usr/sbin" \ "/sbin" \ "${HOME}/.cabal/bin" \ "${HOME}/.cargo/bin" \ "${HOME}/bin"; do case :$PATH: in *:${dir}:*) # ${dir} already in PATH ;; *) PATH="${dir}:${PATH}";; esac done