I want run a script as follows:
runner: ssh 'java program &' ssh 'java program &'
How do I write the script to fork the first process? Currently, it waits for it to finish.
thanks
I want run a script as follows:
runner: ssh 'java program &' ssh 'java program &'
How do I write the script to fork the first process? Currently, it waits for it to finish.
thanks
In your script:
#!/bin/sh
ssh yourhost 'java program &' &
ssh yourhost 'java program &'
The first ssh will start a session running a java program in the background. If the java program is a graphical application and you are running with port forwarding enabled the ssh process will still continue running even after the command java program &
is finished. By adding the final &
to the first command line the ssh program will be put running in the background.