[英]Need Help in Bash debugging
Im trying to run this code . 我试图运行此代码。 Basically I want the https://admin:qwerty123@ '"$dmp"':7777/set_param?'"$params command to run 3 times for every ip in array. But Im getting errors like
基本上,我希望https:// admin:qwerty123 @ '“ $ dmp”':7777 / set_param?'“ $ params命令为数组中的每个IP运行3次。
prog.sh: line 7: syntax error near unexpected token `while'
prog.sh: line 7: `while [ $n -lt 3 ]; do'
Please can someone correct the code 请有人可以更正代码
#!/bin/bash
n="0"
dmps=(10.104.164.104 10.35.176.77 10.35.176.126) # ***** put your dmp ips here *******
for dmp in ${dmps[@]};
while [ $n -lt 3 ]; do
do res=$(curl -k -s --url 'https://admin:qwerty123@'"$dmp"':7777/set_param?'"$params");
echo "DMP: $dmp - $res";
n=$[n+1]
done
done
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.