0
我想爲文本文件的每一行運行一次bash命令。將文本文件的行替換爲bash命令
如果我做的:
while read l; do
echo $l;
done < myfile.txt
我得到的每一行呼應。
但是,當我用我的實際命令:
while read l; do
curl -X POST http://somedomain -H "Content-Type: application/json" -d $l
done < myfile.txt
我得到的錯誤。我認爲這可能與文本文件中的轉義字符有關,但我沒有嘗試過。爲文本文件的每一行運行一次curl表達式的正確方法是什麼?
請發佈**相關**錯誤消息逐字。 –