bash shell 当我回显或尝试创建命令时,脚本将最后一项放在第一位
bash shell script is putting the last item first when I echo or try to create a command
我很困惑。为什么最后一个项目最先被回显?
echo -e "\n\nPROCESS: cik : $cik companyName : $companyName form : $form date : $dateStr textURL : $textURL ID : $ID"
OUTPUT:
ID : 6f89f534-2c81-4338-89ac-f691c842b8f1LION FINANCIAL CORP form : 40-17F2 date : 2017-01-05 textURL : edgar/data/1000209/0001193125-17-002593.txt
它为另一个创建 curl 命令的尝试执行此操作。
echo curl -XPUT "$ES_HOST/edgar/filing/$ID" -H 'Content-Type: application/json' -d'{"cik":"'$cik'","companyName":"'$companyName'","form":"'$form'","date":"'$date'","textURL":"'$textURL'","data":"'$data'"}'
打印为
-o /tmp/foo.txt.sec.gov/Archives/edgar/data/1000209/0001193125-17-002593.txt
WTH 是怎么回事?
我的猜测是 $textURL
的末尾有一个回车符 return,因此在打印 id 之前光标被移回行首
我很困惑。为什么最后一个项目最先被回显?
echo -e "\n\nPROCESS: cik : $cik companyName : $companyName form : $form date : $dateStr textURL : $textURL ID : $ID"
OUTPUT:
ID : 6f89f534-2c81-4338-89ac-f691c842b8f1LION FINANCIAL CORP form : 40-17F2 date : 2017-01-05 textURL : edgar/data/1000209/0001193125-17-002593.txt
它为另一个创建 curl 命令的尝试执行此操作。
echo curl -XPUT "$ES_HOST/edgar/filing/$ID" -H 'Content-Type: application/json' -d'{"cik":"'$cik'","companyName":"'$companyName'","form":"'$form'","date":"'$date'","textURL":"'$textURL'","data":"'$data'"}'
打印为
-o /tmp/foo.txt.sec.gov/Archives/edgar/data/1000209/0001193125-17-002593.txt
WTH 是怎么回事?
我的猜测是 $textURL
的末尾有一个回车符 return,因此在打印 id 之前光标被移回行首