Search Results

Search: Posts Made By: p.f.moore
11,289
Posted By p.f.moore
I'm not sure - sleep without an argument sleeps...
I'm not sure - sleep without an argument sleeps forever (until a signal comes in). So the intent of the statement is - if we have too many processes, pause. When SIGCHLD comes in, we are awakened,...
11,289
Posted By p.f.moore
Ah! It never occurred to me that I could use ps...
Ah! It never occurred to me that I could use ps to check if workers were still running. That looks pretty good. And it looks like it will work just as well in ksh, too.

I'll give it a try. Thanks...
11,289
Posted By p.f.moore
Ah, thanks! Yes, you're right that is an issue. ...
Ah, thanks! Yes, you're right that is an issue.

I'll have a look at fixing this, I can probably also do it with a SIGCHLD handler I guess.

Paul.
11,289
Posted By p.f.moore
I tried seeing what I could do with Perl, and I...
I tried seeing what I could do with Perl, and I got this, which seems to work:
#!/usr/bin/perl
sub spawn {
$pid = fork;
unless ($pid) {
exec "@_";
}
$pid
}
@pids =...
11,289
Posted By p.f.moore
I tried a perl solution and got really bogged...
I tried a perl solution and got really bogged down because I couldn't find an easy way of running a background command (disclaimer: it's a VERY long time since I used perl, but I don't have Python on...
11,289
Posted By p.f.moore
Thanks, that's an approach I hadn't thought of....
Thanks, that's an approach I hadn't thought of. One thing it doesn't allow me to do is to report progress - something I'd thought of adding to my original approach was to add a "printf '.'" whenever...
11,289
Posted By p.f.moore
Waiting for an arbitrary background process (limiting number of jobs running)
Hi,
I'm trying to write a script to decompress a directory full of files. The decompression commands can run in the background, so that many can run at once. But I want to limit the number running...
Showing results 1 to 7 of 7

 
All times are GMT -4. The time now is 12:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy