Skip to content

Instantly share code, notes, and snippets.

@tfolbrecht
Created December 1, 2019 23:23
Show Gist options
  • Select an option

  • Save tfolbrecht/7db420751edfe4a5db4612495c19a008 to your computer and use it in GitHub Desktop.

Select an option

Save tfolbrecht/7db420751edfe4a5db4612495c19a008 to your computer and use it in GitHub Desktop.
AWS Bash Prompt with username and response encoding
#!/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\]"
@tfolbrecht
Copy link
Author

Nice for starting up a script!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment