Discipulus has asked for the wisdom of the Perl Monks concerning the following question:
greetings from roma Lor*#!/usr/bin/perl -w use strict; $|=1; my @ip qw (192.168.0.1 192.168.0.2 192.168.0.3) my $kid; foreach my $host(@ip) { next if $kid = fork; die "fork: $!" unless defined $kid; & doit ($host); exit; } 1 while wait != -1; print "Parent exiting...\n"; exit; sub doit { my $server = shift; open RCMD, "rcmd \\\\$server ipconfig|"; while (<RCMD>){if ($_=~/Executing/){print "$_\n";}} close RCMD; sleep 1; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: 1 while wait != -1; on w2k
by tachyon (Chancellor) on Mar 11, 2004 at 13:41 UTC |