我有一个shell脚本,其中包含以下命令:
SNAPSHOT_ID=$(bash <<-EOF
aws rds create-db-snapshot
--db-instance-identifier $RDS_INSTANCE_ID
--db-snapshot-identifier $RDS_INSTANCE_ID-manual-$NOW_DATE
--query 'DBSnapshot.[DBSnapshotIdentifier]' --output text
EOF
)
但我收到了这个错误:
第191行:寻找匹配`时意外的EOF‘
我怎么才能解决这个问题?
发布于 2019-09-26 15:47:57
我不确定这是否是您的情况,但是如果第二个EOF
没有从第一行(第1列)开始,您将得到这样一个错误。例如:
[root@tsekmanrhel771 ~]# cat eoftest.sh
#!/bin/sh
SNAPSHOT_ID=$(bash <<-EOF
aws rds create-db-snapshot
--db-instance-identifier $RDS_INSTANCE_ID
--db-snapshot-identifier $RDS_INSTANCE_ID-manual-$NOW_DATE
--query 'DBSnapshot.[DBSnapshotIdentifier]' --output text
EOF
)
[root@tsekmanrhel771 ~]# ./eoftest.sh
./eoftest.sh: line 3: unexpected EOF while looking for matching `)'
./eoftest.sh: line 10: syntax error: unexpected end of file
https://stackoverflow.com/questions/58120225
复制相似问题