1
我將wget捲曲捲曲成捲曲。從終端運行它,所有的變量都正確通過正確的價值觀退出代碼替換爲0將wget捲曲成捲曲
wget -O - $DOWNLOAD_URL | curl -H "Authorization:token $TOKEN" -H "Accept:application/vnd.github.v3+json" -H "Content-Type:application/zip" --data-binary @- "https://uploads.github.com/repos/myorg/myrepo/releases/$RELEASE_ID/assets?name=$NAME.zip"
echo $? # 0
運行它的腳本里面的子shell哪裏還所有的變量都正確地更換 和狀態代碼爲127加錯誤消息「沒有這樣的文件或目錄「
$(wget -O - $DOWNLOAD_URL | curl -H "Authorization:token $TOKEN" -H "Accept:application/vnd.github.v3+json" -H "Content-Type:application/zip" --data-binary @- "https://uploads.github.com/repos/myorg/myrepo/releases/$RELEASE_ID/assets?name=$NAME.zip")
echo $? # 127
任何線索?
感謝@Barmar - 它原來,我並不需要子shell結束;-)但現在我意識到不同之處 – szydan