当前位置: 技术问答>linux和unix
【求助】bat文件 转 sh文件的问题!
来源: 互联网 发布时间:2016-06-26
本文导语: windows下的java工程要移植到 Linux下, 各位大侠,哪位能帮忙把下面的2个 bat文件转成可在 Linux下运行的sh文件呀? 1)db.bat set APP_HOME=.. "%JAVA_HOME%/bin/java" -cp "%APP_HOME%lib/hsqldb.jar" org.hsqldb.Server -database.0 file:logdata....
windows下的java工程要移植到 Linux下,
各位大侠,哪位能帮忙把下面的2个 bat文件转成可在 Linux下运行的sh文件呀?
1)db.bat
set APP_HOME=..
"%JAVA_HOME%/bin/java" -cp "%APP_HOME%lib/hsqldb.jar" org.hsqldb.Server -database.0 file:logdata.0 xdb
2)run.bat
echo Starting db..
start db.bat
ping /n 5 127.0.0.1>nul
echo Starting rmiregistry...
ping /n 1 127.0.0.1>nul
start rmiregistry
echo Starting rmiserver...
set CP=
setlocal EnableDelayedExpansion
set APP_HOME=..
set CP.
=for %%a in ("%APP_HOME%lib*.jar") do (
set CP=%%a;!CP!
)
"%JAVA_HOME%/bin/java" -cp "%CP%;." -Djava.security.policy=%APP_HOME%security.policy -Djava.rmi.server.codebase=file:/%cd%/ connectorserver.ConnectorServerRun log4j.properties
endlocal
pause
各位大侠,哪位能帮忙把下面的2个 bat文件转成可在 Linux下运行的sh文件呀?
1)db.bat
set APP_HOME=..
"%JAVA_HOME%/bin/java" -cp "%APP_HOME%lib/hsqldb.jar" org.hsqldb.Server -database.0 file:logdata.0 xdb
2)run.bat
echo Starting db..
start db.bat
ping /n 5 127.0.0.1>nul
echo Starting rmiregistry...
ping /n 1 127.0.0.1>nul
start rmiregistry
echo Starting rmiserver...
set CP=
setlocal EnableDelayedExpansion
set APP_HOME=..
set CP.
=for %%a in ("%APP_HOME%lib*.jar") do (
set CP=%%a;!CP!
)
"%JAVA_HOME%/bin/java" -cp "%CP%;." -Djava.security.policy=%APP_HOME%security.policy -Djava.rmi.server.codebase=file:/%cd%/ connectorserver.ConnectorServerRun log4j.properties
endlocal
pause
|
写错了。
(1) db.sh
(2) run.sh
(1) db.sh
#!/bin/sh
APP_HOME=..
"$JAVA_HOME/bin/java" -cp "$APP_HOME/lib/hsldb.jar" org.hsqldb.Server -database.0 file:logdata.0 xdb
(2) run.sh
#!/bin/sh
echo Starting db..
./db.sh
ping /n 5 127.0.0.1 >/dev/null
echo Starting rmiregistry...
ping /n 1 127.0.0.1 >/dev/null
./rmiregistry
echo Starting rmiserver...
APP_HOME=..
CP=.
for a in "%APP_HOME%lib*.jar"
do
CP=$a;$CP
done
"$JAVA_HOME/bin/java" -cp "$CP" -Djava.security.policy=$APP_HOME/security.policy -Djava.rmi.server.codebase=file:/`PWD`/ connectorserver.ConnectorServerRun log4j.properties
read -p "Press any key to continue..."
|
(1) db.sh
(2) run.sh
#!/bin/sh
APP_HOME=..
"$JAVA_HOME/bin/java" -cp "$APP_HOME/lib/hsldb.jar" org.hsqldb.Server -database.0 file:logdata.0 xdb
(2) run.sh
#!/bin/sh
echo Starting db..
./db.sh
ping -c 5 127.0.0.1 >/dev/null
echo Starting rmiregistry...
ping -c 1 127.0.0.1 >/dev/null
rmiregistry
echo Starting rmiserver...
APP_HOME=..
CP=.
for a in "%APP_HOME/lib/*.jar"
do
CP=$a;$CP
done
"$JAVA_HOME/bin/java" -cp "$CP" -Djava.security.policy=$APP_HOME/security.policy -Djava.rmi.server.codebase=file:/$PWD/ connectorserver.ConnectorServerRun log4j.properties
read -p "Press any key to continue..."