简体   繁体   中英

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.

<(...) is a bash extension, it's not available in /bin/sh . You don't need it for your script, you should be using $(...) there.

decrypt=$(aws kms decrypt --ciphertext-blob fileb://$(echo "$USERNAME" | base64 -d))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM