Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ninapavlich
Created October 1, 2020 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ninapavlich/90c3142a445e9258687666295d46ff0f to your computer and use it in GitHub Desktop.
Save ninapavlich/90c3142a445e9258687666295d46ff0f to your computer and use it in GitHub Desktop.
# Try to get the profile path
PROFILE_PATH=''
getProfilePath(){
if [[ "$SHELL" == *"zsh"* ]]; then
PROFILE_PATH=$HOME/'.zshrc'
elif [[ "$SHELL" == *"bash"* ]]; then
if [ -f $HOME/.bashrc ]; then
PROFILE_PATH=$HOME/'.bashrc'
elif [ -f $HOME/.profile ]; then
PROFILE_PATH=$HOME/'.profile'
elif [ -f $HOME/.bash_profile ]; then
PROFILE_PATH=$HOME/'.bash_profile'
fi
fi
}
getProfilePath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment