Run a script in parallel

Hey,

I am new to UNIX scripting . I have script (ex: start_script) that starts a job in 10 different servers one server after another.Now I want to modify the script so that the script starts the job in all servers parallely (at a time in all servers).and I need the choice of selecting the servers.How can this be made possible.

Assumptions are never good, but you've given little to go on, so Im assuming:

1) Ksh or maybe bash
2) you'll start the remote 'jobs' with ssh
3) the list of remote hosts is in some file, maybe with the command to execute on that particular host

#!/usr/bin/env ksh
# this is completely untested!!!

while read host command
do
   echo "$(date) starting on $host: $command"
   ssh -n $host "$command" >/tmp/log/foo.$host 2>&1 &
done <job-list-file

wait
echo "$(date) all remote jobs finished"

The job file contains the host names followed by the exact command you'd like to run on that host.

hey thanks for ur reply...

From ur reply my understanding is my script shld be modified like this

##
#my script

shh $hostname $start_script &

##

but my start_script has few functions like user validation,etc
wht happens to this, will I get the prompt on the shell to validate the user..etc

You might get a prompt, might not. Set up ssh keys is the best way.