home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.madoka.org
/
2014.12.ftp.madoka.org.tar
/
ftp.madoka.org
/
pub
/
plum
/
2.x
/
plum2_26_1.lzh
/
support
/
runfor
< prev
next >
Wrap
Text File
|
1998-07-31
|
499b
|
32 lines
#!/bin/perl -w
# $Id: runfor,v 2.2 1997/12/13 23:17:42 hasegawa Exp $
# copyright (c)1997 pupu_j <hasegawa@agusa.nuie.nagoya-u.ac.jp>
$WAITTIME = 60;
&main(@ARGV);
sub main {
local(@args) = @_;
local($pid);
if (@args < 1) {
&usage();
exit(1);
}
for (;;) {
$pid = fork();
if (!defined($pid)) {
sleep($WAITTIME);
} elsif ($pid == 0) {
exec(@args);
} else {
wait;
}
}
}
sub usage {
print 'usage: perl runfor <command> [<args>]', "\n";
}