LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 07-28-2003, 11:06 AM   #1
Punker99
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, 11:10 AM   #2
kev82
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, 11:21 AM   #3
Punker99
LQ Newbie
 
Registered: Jul 2003
Posts: 2

Original Poster
Rep: Reputation: 0
O_O

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


Reply


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 07:26 AM
what happens if i create a thread and then fork the process? Thinking Programming 7 10-31-2005 02:22 PM
Bash Scripting - child process affecting parent process mthaddon Linux - General 1 05-02-2004 01:19 PM
collecting data from fork process frostmagic Programming 5 12-28-2003 01:55 PM
fork() by Process 0 Manish Programming 0 02-23-2002 05:03 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:08 PM.

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