![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Execute db2 commands in unix | rollthecoin | AIX | 3 | 04-26-2008 01:17 AM |
| lom don't execute commands | pasalagua | SUN Solaris | 6 | 01-25-2008 04:22 PM |
| How to execute multiple commands via ssh | srage | Shell Programming and Scripting | 9 | 01-05-2008 03:18 AM |
| Execute Loop in Telnet | Dastard | Shell Programming and Scripting | 2 | 07-24-2007 11:38 AM |
| how to execute a while loop for 20 minutes? | subhotech | UNIX for Dummies Questions & Answers | 6 | 07-05-2007 02:54 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Execute commands parallel in a for loop ?
Hi,
please can someone point me in the right direction with a shell scripting problem. I want to execute a command in a for loop and the command should be started not one-by-one meaning the for loop is waiting for the exit code , it should be started in parallel. I have a plain text file where a hostname stands in each line. #!/bin/bash file="/tmp/serverlist" for server in `cat $file` ; do ssh admin@$server "command to run" done the problem is : the command I execute with SSH takes approx. 10 minutes to complete. I have to run the command on 145 servers and I dont want to wait 10 mins to go to the next. I want to execute it in parallel say on 10 servers at a time. Any ideas ? simply putting a & after the SSH commands didnt work, nor with continue ? thanks for your help again... |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|