我想創建一個.bat文件爲Linux是:爲應用程序的現有實例檢查在Linux中BAT重複申請
- 檢查,然後
- 啓動應用程序的初始實例或向前調用現有實例。
我目前有一個.bat(下)可以在一臺Linux機器上運行,但是它不能在其他機器上運行。
#!/bin/bash
pid=`ps axwww | grep filename | grep java | sed -e 's/^[ \t]*//' | cut -f1 -d " "`
if [ a$pid == "a" ]
then
java -Djava.net.preferIPv4Stack=true -Dsun.java2d.opengl=true -jar filename.jar /home/user/Desktop/folder/config/FILENAMEConfig.properties
else
wid=`xdotool search "FILENAME"`
xdotool windowactivate $wid
fi
我的問題是,當我這個蝙蝠複製到另一臺機器,它給我的錯誤:
Defaulting to search window name, class, and classname XGetWindowProperty[_NET_WM_DESKTOP] failed (code=1)
我已經試過手動第二臺機器上輸入一個新的蝙蝠 - 仍失敗。
任何幫助,非常感謝。
標籤[標籤:批處理文件]在這裏並不適用,因爲這僅與DOS/Windows有關... – aschipfl