If i enter this line directly to terminal it works and does what it's supposed to:
Code:
echo 'P=`ps auxc | grep btsco`; if [ "x$P" == "x" ]; then `btsco -r -f 00:1A:45:07:B7:A4`& fi' |bash -f -s
My goal is to create script with endless loop, entering that command above every 45second, but i'm unable to do so. Here is what i have tried, but it gives me errors:
Code:
#!/bin/sh
while true
do
P=`ps auxc | grep btsco`
if [ "x$P" == "x" ]
then 'btsco -r -f '00:1A:45:07:B7:A4'& fi' |bash -f -s
sleep 45
done
It gives me:
./btsco2.sh: line 8: syntax error near unexpected token `done'
./btsco2.sh: line 8: `done'
Please help me
-Tine