我是bash的新手,尝试通过简单地调用
aws cloudfront create-invalidation --distribution-id XXX --profile XXX --path /planning/index.html
字符串
在cmd中运行良好,但在git bash中不行。一定是一些转义字符的问题,但我不太明白它应该是怎样的。
更新:错误消息Im getting in bash when calling the CreateInvalidation operation: Your request contains one or more invalid invalidation paths
已解决:通过提供cli-input-json
解决
aws cloudfront create-invalidation --profile $PROFILE --cli-input-json "{\"DistributionId\":\"MY_DISTRIBUTION_ID\",\"InvalidationBatch\":{\"Paths\":{\"Quantity\":1,\"Items\":[\"/planning/index.html\"]},\"CallerReference\":\"$(date +%s)\"}}"```
型
1条答案
按热度按时间qlfbtfca1#
在git bash中,这是一个很好的例子:
字符串
斜杠必须是双斜杠。可能与此问题有关:Passing windows slash (/) based parameters to a program from bash script