Java code to execute a .sh file

后端 未结 5 987
暖寄归人
暖寄归人 2020-12-22 05:34

I have a .sh file stored in some Linux system. The full path of the file is:

/comviva/CPP/Kokila/TransactionHandler/scripts/stopTH.sh
         


        
5条回答
  •  遥遥无期
    2020-12-22 05:48

    To execute a .sh script on Windows, you would have to have a suitable command interpreter installed. For example, you could install the Cygwin environment on your Windows box and use it's bash interpreter.

    However, Windows is not Linux even with Cygwin. Some scripts will not port from one environment to the other without alterations. If I had a problem executing a script via Java in Linux environment, I would prefer to debug the issue in that environment.

    Remember, you could start your Java process on Linux in debug mode and attach your IDE debugger in Windows to that remote process.

提交回复
热议问题