以下curl语句在我的shell脚本中正常工作.
curl -Ld'username=user&password=password&source=oksoft&dmobile='$mnumber'&message=Slave is working OK' http://167.123.129.195/smsclient//api.php
Run Code Online (Sandbox Code Playgroud)
手机号码按预期扩展.但是当我使用变量作为message参数时,我得到$ myvar输出而不是扩展变量.
curl -Ld'username=user&password=password&source=oksoft&dmobile='$mnumber'&message="$myvar"' http://167.123.129.195/smsclient//api.php
Run Code Online (Sandbox Code Playgroud)
如何将该变量用于消息?