home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.madoka.org
/
2014.12.ftp.madoka.org.tar
/
ftp.madoka.org
/
pub
/
plum
/
plum2_33_1.lzh
/
support
/
runfor
< prev
next >
Wrap
Text File
|
1999-03-24
|
496b
|
32 lines
#!/bin/perl -w
# $Id: runfor,v 2.3 1998/11/11 03:25:35 hasegawa Exp $
# copyright (c)1997 Yoshinori Hasegawa <hasegawa@madoka.org>
$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";
}