无与伦比的闭合支架/支架
我正试图在Bash中执行一个脚本,但是把这个错误扔了,
curl: (3) URL using bad/illegal format or missing URL
curl: (3) URL using bad/illegal format or missing URL
curl: (3) URL using bad/illegal format or missing URL
curl: (3) unmatched close brace/bracket in URL position 24:
UTC","user_id":"01234"}}
我尝试删除牙套,但不起作用,这是行,
response=$(curl -X POST -H "Authorization: Bearer ${bearer_token}" -H "Content-Type: application/json" -d '{"cursus_user":{"begin_at":"'${start}'","cursus_id":"'${cursus_id}'","end_at":"'${end}'","user_id":"'${user}'"}}' "https://xxxxxx/xxxxxx.com")
任何人都知道问题在哪里?
[更新]
我真的看不到错误:(
'
{
"cursus_user":
{
"begin_at": "'${start}'",
"cursus_id": "'${cursus_id}'",
"end_at": "'${end}'",
"user_id": "'${user}'"
}
}
'
I'm trying to execute an script in bash, but throw me this error,
curl: (3) URL using bad/illegal format or missing URL
curl: (3) URL using bad/illegal format or missing URL
curl: (3) URL using bad/illegal format or missing URL
curl: (3) unmatched close brace/bracket in URL position 24:
UTC","user_id":"01234"}}
i tried removing the braces but does not work, this is the line,
response=$(curl -X POST -H "Authorization: Bearer ${bearer_token}" -H "Content-Type: application/json" -d '{"cursus_user":{"begin_at":"'${start}'","cursus_id":"'${cursus_id}'","end_at":"'${end}'","user_id":"'${user}'"}}' "https://xxxxxx/xxxxxx.com")
Anyone know where is the issue?, i'm stuck, thanks in advance.
[ UPDATE ]
Really i can't see the error :(
'
{
"cursus_user":
{
"begin_at": "'${start}'",
"cursus_id": "'${cursus_id}'",
"end_at": "'${end}'",
"user_id": "'${user}'"
}
}
'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这实际上是格式的评论。
两个提示:
This is really more of a formatted comment.
Two tips:
shellCheck 标识
curl
命令中的几个未引用的变量。它甚至提供了校正的代码:使用 shellCheck 在使用Shell Code时,通常会节省很多时间。
Shellcheck identifies several unquoted variables in the
curl
command. It even provides the corrected code:Using Shellcheck often saves a lot of time when working with shell code.
添加其他双引号;说。,
“'” $ {start}“'”
而不是“'$ {start}'”
add additional double quotes; say.,
"'"${start}"'"
instead of"'${start}'"