Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 07-28-2003, 12:06 PM   #1
LQ Newbie
Registered: Jul 2003
Posts: 2

Rep: Reputation: 0
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?
Old 07-28-2003, 12:10 PM   #2
Senior Member
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
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 &
Old 07-28-2003, 12:21 PM   #3
LQ Newbie
Registered: Jul 2003
Posts: 2

Original Poster
Rep: Reputation: 0

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how a father process know which child process send the signal SIGCHLD icoming Programming 10 07-20-2010 08:26 AM
what happens if i create a thread and then fork the process? Thinking Programming 7 10-31-2005 03:22 PM
Bash Scripting - child process affecting parent process mthaddon Linux - General 1 05-02-2004 02:19 PM
collecting data from fork process frostmagic Programming 5 12-28-2003 02:55 PM
fork() by Process 0 Manish Programming 0 02-23-2002 06:03 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:08 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration