# https://gist.github.com/15joeybloom/3a24c60b191836deed144c760a0799e0 aws_profile_prompt() { if [ -z "${AWS_PROFILE+foo}" ] ; then # Check if AWS_PROFILE set printf "" elif [ -z "$AWS_PROFILE" ] ; then # Check if AWS_PROFILE empty # italic, red bg, black fg printf "\001\033[3;48;5;1;38;5;16m\002AWS Profile empty!\001\033[0m\002 " else # bold, yellow bg, black fg printf "\001\033[1;48;5;220;38;5;16m\002AWS Profile: $AWS_PROFILE\001\033[0m\002 " fi } export PS1="\$(aws_profile_prompt)$PS1"