今天写一个while脚本,发现报错:Syntax error: “then” unexpected (expecting “done”)
代码段如下:
while :doif[ "$HW" = "$HW1" ];thenbreakelsesleep 0.5fidone
查资料说是linux和windows的环境不一样,最后重新手敲了一遍,发现是if后没有加空格导致
记录一下,自己的粗心大意
时间:2021-07-21 23:40:22
今天写一个while脚本,发现报错:Syntax error: “then” unexpected (expecting “done”)
代码段如下:
while :doif[ "$HW" = "$HW1" ];thenbreakelsesleep 0.5fidone
查资料说是linux和windows的环境不一样,最后重新手敲了一遍,发现是if后没有加空格导致
记录一下,自己的粗心大意