On Mon, Dec 03, 2001 at 03:59:34PM -0600, Jamie Seeman wrote:
> >
> 
> You could add this, so you don't have to edit the script every
> time you want to run  it.

Well, you don't have to edit the script every time with my
version, though your way would work as well.  With my version
any command line options are used as the command.  So to kill
ftpd on all machines type: 'grun killall ftpd' .

In my version, the command is set by this line:
$command= "uname -n; @ARGV";  


> >
> >
> > #!/usr/local/bin/perl
> > # run input command on all machines.
> >
> > @machine_list=("mach1", "mach2", "mach3");
> > # Will run commandline parameters as a command on each machine.
> > # uname added to help separate output from different machines.
> 
> print "What command would you like to run: ";
> chomp($command = <STDIN>);
> 
> 
> >
> > foreach $machine (@machine_list) {
> >   print "\nssh $machine $command &\n";
> >   system "ssh $machine $command  &";
> > }

-- 
Jim Crumley                  |Twin Cities Linux Users Group Mailing List (TCLUG)
crumley at fields.space.umn.edu |Minneapolis/St. Paul, Minnesota 
Ruthless Debian Zealot       |http://www.mn-linux.org/ 
Never laugh at live dragons  |Free Dmitry Sklyarov - http://faircopyright.org/