0

I am trying to run ~bin/ap script multiple times with

dims@pterosaur:~$ while true; ~bin/ap; sleep 2; done
bash: syntax error near unexpected token `done'

where

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]"

What's wrong here?

2
  • 6
    missed do after the first ; Commented Nov 7, 2016 at 11:54
  • 1
    Should be while true; do "$HOME/bin/ap" …
    – Costas
    Commented Nov 7, 2016 at 12:28

1 Answer 1

1

Try (also from @IporSircer comment) this instead:

while true;do~/bin/ap; sleep 2; done

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .