bash - entrypoint.sh - line 9: syntax error: unexpected "("
问题描述
I am trying to run the following script from docker (based on alpine image)
#!/bin/sh
echo "test"
export USERNAME="AQICAHj456mvH8iSJofL46Xtr7KP6Ng3Vn5k6BpZbkAAAAZTBjBgkqhkiG9w0BBwagVjBUAgEAME8GCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMwCm8C+wSLRm/+sSuAgEQgCJHCFbrIwCQuH0x2iGp13j9SuxMtfrcE6c4SmrHRVkkX24f"
export AWS_REGION="us-east-1"
echo "$AWS_REGION"
decrypt=$(aws kms decrypt --ciphertext-blob fileb://<(echo "$USERNAME" | base64 -d))
export $key="$(echo $decrypt | jq .Plaintext -r | base64 -d)"
exec "$@"
I am getting the below output
test
us-east-1
/bin/entrypoint.sh: line 9: syntax error: unexpected "("
I am not sure how to resolve this syntax error. Any help is appreciated.
解决方案
<(...)
是一个bash
扩展,它在/bin/sh
. 您的脚本不需要它,您应该在$(...)
那里使用它。
decrypt=$(aws kms decrypt --ciphertext-blob fileb://$(echo "$USERNAME" | base64 -d))
推荐阅读
- css - 如何在导航栏品牌部分修复bulma导航栏下拉菜单
- python - 在移动设备中部署默认 tflite 时,常见对象检测精度较差
- python - docplex 中使用用户剪切回调方法技术的示例
- azure - 我可以在 Azure Functions 应用程序中使用 Ravendb 的嵌入式实例吗?
- apache-spark - Pyspark concat 列基于其他列值
- javascript - 使用 D3 的 3D 曲面图
- java - 如何更新执行者时间?
- flutter - 使用自定义小部件在列表中给出错误
- android - 应用关闭时获取位置更新 Android
- python - 调用具有动态对象名 pyqt5 的函数