I have a Java program that runs a batch file on Windows with Runtime.getRuntime().exec() using the following command:
cmd /C start "Title" "C:\Folder\file.bat"
The Java program ends quickly since cmd /C carries out the command and then terminates (1) and start "Title" "C:\Folder\file.bat" starts the batch script (2). Thus the process (the batch file) will continue running independently.
Now, suppose that I have an shell script (e.g. file.sh), which I want to launch from Java and has a similar behavior. How could it be the equivalent command (3) in Linux?
Notes
- See CMD.exe (Command Shell) | Windows CMD | SS64.com
- See Start - Start a program | Windows CMD | SS64.com
- The title (
"Title") is not required.