Skip to content

Instantly share code, notes, and snippets.

@n-st
Created May 29, 2016 12:04
Show Gist options
  • Save n-st/74f5ce07391bf8e95f5d8a6b452f6da8 to your computer and use it in GitHub Desktop.
Save n-st/74f5ce07391bf8e95f5d8a6b452f6da8 to your computer and use it in GitHub Desktop.

Revisions

  1. n-st created this gist May 29, 2016.
    13 changes: 13 additions & 0 deletions .bash_profile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    # .bash_profile is executed for login shells,
    # .bashrc is executed for interactive non-login shells.
    # We want the same behaviour for both, so we source .bashrc from .bash_profile.
    # Also, when .bash_profile exists, bash ignores .profile, so we have to source
    # it explicitly.

    if [ -f "$HOME/.profile" ]; then
    . "$HOME/.profile"
    fi

    if [ -f "$HOME/.bashrc" ]; then
    . "$HOME/.bashrc"
    fi
    14 changes: 14 additions & 0 deletions .bashrc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    # .bash_profile is executed for login shells,
    # .bashrc is executed for interactive non-login shells.
    # We want the same behaviour for both, so we source .bashrc from .bash_profile.

    if [ -z "${NOZSH}" ] && [ $TERM = "xterm" -o $TERM = "xterm-256color" -o $TERM = "screen" ] && type zsh &> /dev/null
    then
    export SHELL=$(which zsh)
    if [[ -o login ]]
    then
    exec zsh -l
    else
    exec zsh
    fi
    fi