Mac command line cheat sheet
Behavior | Command | Comment |
go to the beginning of the line | ctrl+a | |
go to the end of the line | ctrl+e | |
Save a output of a command to a env variable | principle_arn=$(aws –profile perAdmin sts get-caller-identity –query Arn –output text) | |
use a env variable | ${principle_arn} | |
replace character | sed -e “s|PRINCIPAL_ARN|${principle_arn}|g” \ assume-role-policy-template.json > assume-role-policy.json | The delimiter of choice is a forward slash (/), which is the most commonly used delimiter. However, sed can use any character as a delimiter. In fact, it will automatically use the character following the s as a delimiter -e means you can use the followed scripts multiple times. https://unix.stackexchange.com/questions/33157/what-is-the-purpose-of-e-in-sed-command |