我試圖建立一個協同自動啓動腳本按照this article,外殼是給我的錯誤shell腳本[行預計年底等,但發現未知的令牌]
語法錯誤
預期線等的結束,但發現 未知令牌
這裏是腳本我工作...
#!/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
"[email protected]"
fi
sleep 3
done
}
StartService()
{
ConsoleMessage "Starting Synergy"
KeepAlive "${run[@]}" &
}
StopService()
{
return 0
}
RestartService()
{
return 0
}
RunService "$1"
當被拋出的錯誤,「期間」突出顯示該線路上. /etc/rc.common
有我丟失的東西嗎?該文件
你已經發布的代碼是不是AppleScript的,這是一個shell腳本。如果鏈接中的方向談論創建「腳本」,他們只是一個文本文件。 – Isaac 2010-03-13 21:46:02
@rock:你用什麼程序來編寫腳本? – outis 2010-03-13 21:52:13
@Isaac,我沒有意識到...我用什麼擴展[.txt]? @outis,我使用AppleScript編輯器。 – 2010-03-13 21:59:13