Linux,  工具,  技术

Mac command line cheat sheet

BehaviorCommandComment
go to the beginning of the linectrl+a
go to the end of the linectrl+e
Save a output of a command to a env variableprinciple_arn=$(aws –profile perAdmin sts get-caller-identity –query Arn –output text)
use a env variable${principle_arn}
replace charactersed -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

Leave a Reply

Your email address will not be published. Required fields are marked *