LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   how to fork a process? (https://www.linuxquestions.org/questions/programming-9/how-to-fork-a-process-76626/)

Punker99 07-28-2003 11:06 AM

how to fork a process?
 
Hi all. I'm trying to write a script that will login to 10 different machines via ssh and execute the same command on every machine. I want the command to run simultaneously on each machine, but whenever I try to run the script it logs into the first machine, runs the command, then waits for the command to return before exiting and logging into the next machine. I'd like the script to just login, run the command, then exit the remote machine (leaving the command running) and login to the next machine. Is there a way to do this through a bash script?

As I understand it I should be able to fork the command off of the ssh process, so when I exit ssh the command will still be left running on the remote machine. I just have no idea how to fork a command off. Does anyone have any idea how to do this?

kev82 07-28-2003 11:10 AM

why not just run all the ssh's in the background. to run a command in the background just put a & at the end eg:

bash$ CommandToRunInTheBackground &

Punker99 07-28-2003 11:21 AM

O_O

Don't you hate it when the answer is so flippin' obvious?


All times are GMT -5. The time now is 04:01 AM.