Created
December 1, 2019 23:23
-
-
Save tfolbrecht/7db420751edfe4a5db4612495c19a008 to your computer and use it in GitHub Desktop.
AWS Bash Prompt with username and response encoding
This file contains hidden or 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
| #!/bin/bash | |
| user=$(cat $AWS_SHARED_CREDENTIALS_FILE | grep -o 'aws_access_key_id[^,]*' | cut -d " " -f 3) | |
| encoding=$(cat $AWS_CONFIG_FILE | grep -o 'output[^,]*' | cut -d " " -f 3) | |
| function EXT_COLOR () { echo -ne "\[\033[38;5;$1m\]"; } | |
| # Color, AWS User key ID, Response format, file path | |
| PS1="\[\e[1;33m\][$user:$encoding \w]$ \e[m\]" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice for starting up a script!