我正在尝试~bin/ap
多次运行脚本
dims@pterosaur:~$ while true; ~bin/ap; sleep 2; done
bash: syntax error near unexpected token `done'
在哪里
dims@pterosaur:~$ cat bin/ap
#!/bin/sh
MAC="$(iwconfig wlp2s0 | sed -n 's/.*Access Point: //p' | xargs)"
if [ "$MAC" = "60:E3:27:8D:AC:F0" ]; then
MAC="tplink2"
elif [ "$MAC" = "60:E3:27:8D:7A:A6" ]; then
MAC="tplink1"
fi
echo "[$MAC]"
这是怎么回事?
答案1
尝试(也来自@IporSircer 评论):
while true;
做~/bin/ap; sleep 2; done