我在shell文件中有一个curl命令,如下所示。我通过另一个应用程序执行的操作是重命名此文件,然后执行shell文件。但是,它非常有气质。由于没有明显的原因,它无法读取变量并将其视为空白。通常(但不总是)当我重新创建文件时它确实有效。我正在使用Notepad ++,所以我认为没有间距或换行问题。
感谢您的帮助
vr_id=`basename $0 .sh`
curl "https://www.test.com/control.php/info/loads/? event=showList&wo_id=${vr_id:7}&id=all::0" -H 'Cookie: filemsg=1; var_db=xxxxxxxxxxxxxxxx; __utma=111111.11111111.11111.11111111.1111116.12; __utmb=11111.1.10.1111111; __utmc=1111111; __utmz=111111.111111.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)' -H 'Accept-Encoding: gzip,deflate,sdch' -H 'Host: www.test.com' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.57 Safari/537.36' -H 'Accept: text/javascript, text/html, application/xml, text/xml, */*' -H "Referer: https://www.test.com/control.php/info/loads/?wo_id=${vr_id:7}" -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' -H 'X-Prototype-Version: 1.7' --compressed