TZ=EST5EDT date
update=XYZ
curl -X POST --data-urlencode 'payload={"XXXXX": "#XXXXXX", "username": "test for automation", "text":"'"$update"'","icon_emoji": ":ghost:"}' https://url
如何在curl命令的“text”键中插入update和TZ作为变量?
答案 0 :(得分:0)
我确实将所有变量存储到单个变量中,并在curl命令中使用
TZ=EST5EDT date
Hello=XYZ
Update="$TZ","$Hello"
curl -X POST --data-urlencode 'payload={"XXXXX": "#XXXXXX", "username": "test for automation", "text":"'"$update"'","icon_emoji": ":ghost:"}' https://url