【发布时间】:2020-05-14 00:41:47
【问题描述】:
在执行 load_db 脚本之前尝试通过它的 HTTP 状态检查数据库是否准备好:
db:
## Startup database container, takes about 30 seconds to be available on port 7474
load_db: db
## Check status and break loop if successful
until $(curl --output /dev/null --silent --head --fail http://localhost:7474) ; do \
printf '.' ; \
sleep 5 ; \
done
## load database
每次我运行 make load_db 时,我都会收到错误消息:/bin/bash: -c: line 0: syntax error near unexpected token `;'
【问题讨论】:
-
在 Makefile 中,您需要转义 '$' 以使其到达 shell 解释器。 '$' 变成 '$$':stackoverflow.com/a/29085684/86967
标签: bash shell makefile syntax-error gnu-make