Skip to content

Instantly share code, notes, and snippets.

@johrstrom
Last active September 13, 2023 13:59
Show Gist options
  • Save johrstrom/03498e9599dbcfc39b2005e5a02c3e50 to your computer and use it in GitHub Desktop.
Save johrstrom/03498e9599dbcfc39b2005e5a02c3e50 to your computer and use it in GitHub Desktop.
OSC starter bashrc
# .bashrc
function source_if_exists() {
if [ -f $1 ]; then
. $1
fi
}
function git_branch(){
git rev-parse --abbrev-ref HEAD 2> /dev/null
}
module load ruby/3.0.2 sqlite git nodejs 2>/dev/null
# Source global definitions
source_if_exists /etc/bashrc
# source my own files
source_if_exists "$HOME/.bash_aliases"
export PS1="\[\033[0;36m\][\W(\$(git_branch))] \[\e[0m\] "
export GEM_HOME="$HOME/.gem"
export PATH="$PATH:$GEM_HOME/bin"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment