简体   繁体   English

需要帮助将批处理文件转换为linux shell脚本

[英]Need help converting batch file to linux shell script

I am switching my server's hosting provider from Windows Server to Linux Debian and I need help to convert my Run.bat to an executable shell script. 我将服务器的托管提供程序从Windows Server切换到Linux Debian,我需要帮助将Run.bat转换为可执行的Shell脚本。

The Windows batch file: Windows批处理文件:

java -cp bin; deps/mail.jar; deps/xstream.jar; deps/xpp3-1.1.4c.jar;
deps/scheduling.jar -server server.Server

When I save this as a shell script it does not properly run when I "Run in terminal", the shell just opens and closes immediately. 当我将其另存为Shell脚本时,在“在终端中运行”时它无法正常运行,外壳会立即打开和关闭。

In linux, the separator is : instead of ; 在linux中,分隔符是:而不是; , so try this instead: ,因此请尝试以下操作:

$ java -cp bin:deps/mail.jar:deps/xstream.jar:deps/xpp3-1.1.4c.jar:deps/scheduling.jar -server server.Server

Copy the command without the $. 复制不带$的命令。 The $ is used to indicate the command belongs in a linux shell. $用于指示命令属于linux shell。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM