Last active
March 22, 2016 07:40
-
-
Save pebo/edfc0c47bccb58dd3b9c to your computer and use it in GitHub Desktop.
Show AWS_PROFILE in prompt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# with colors | |
awsp () { | |
export AWS_PROFILE=$1 | |
if [[ $AWS_PROFILE =~ dev ]] | |
then | |
COLOR_PROFILE='\[\033[38;5;70m\]${AWS_PROFILE}\[$(tput sgr0)\]' | |
elif [[ $AWS_PROFILE =~ prod ]] | |
then | |
COLOR_PROFILE='\[$(tput setaf 1)\]${AWS_PROFILE}\[$(tput sgr0)\]' | |
else | |
COLOR_PROFILE='\[$(tput setaf 4)\]${AWS_PROFILE}\[$(tput sgr0)\]' | |
fi | |
export PS1="[$COLOR_PROFILE]:\W \u$ " | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
awsp () { | |
export AWS_PROFILE=$1 | |
export PS1="[$AWS_PROFILE]:\W \u$" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment