Last active
July 21, 2019 17:49
-
-
Save adrianparvino/63180ed630eca9e58b46b05e5782631d to your computer and use it in GitHub Desktop.
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
[default] | |
aws_access_key_id = default | |
aws_secret_access_key = meow | |
[miyu] | |
aws_access_key_id = miyu | |
aws_secret_access_key = meow | |
[myrl] | |
aws_access_key_id = myrl | |
aws_secret_access_key = meow |
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
{ read -r AWS_ACCESS_KEY_ID; | |
read -r AWS_SECRET_ACCESS_KEY; | |
} < <(sed -n '/^\['"$AWS_PROFILE"'\]/,/^\[.\+\]/{ # Get section that starts with $AWS_PROFILE | |
/^aws_access_key_id *= */s///p; # Print AWS_ACCESS_KEY_ID | |
/^aws_secret_access_key *= */x; # Save AWS_SECRET_ACCESS_KEY | |
}; $x;$s/^aws_secret_access_key *= *//p # Print AWS_SECRET_ACCESS_KEY last | |
' < "$AWS_FILE") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment