Shell script [Expected end of line, etc. but found unknown token]
- by rockinthesixstring
I'm trying to build a Synergy AutoStart script as per this article, the shell is giving me the error
Syntax Error
Expected end of line, etc. but found
unknown token
Here is the script I'm working on...
#!/bin/sh
. /etc/rc.common
run=(/usr/local/bin/synergyc -n $(hostname -s) -1 -f 192.168.0.108)
KeepAlive ()
{
proc=${1##*/}
while [ -x "$1" ]
do
if ! ps axco command | grep -q "^${proc}\$"
then
"$@"
fi
sleep 3
done
}
StartService ()
{
ConsoleMessage "Starting Synergy"
KeepAlive "${run[@]}" &
}
StopService ()
{
return 0
}
RestartService ()
{
return 0
}
RunService "$1"
And when the error is thrown, the "period" is highlighted on this line . /etc/rc.common
Is there something I'm missing here?