Others have addressed various other parts of your code, such as why you're
forking twice, what the while loop is for, etc. However, there are a few
things in your code that others haven't addressed.
On Thu, Sep 26, 2002 at 09:20:37AM -0400, chad kellerman wrote:
[snip]
> foreach my $usr (@users
Chad Kellerman wrote:
> david,
>
> actually, without the while loop every user in the array gets forked
> at one time. 500+ forks. I put the while loop in and it does one at a
> time..
>
maybe i am missing something but how is this:
> foreach my $usr (@users) {
> my $UsrPid;
>
david,
actually, without the while loop every user in the array gets forked
at one time. 500+ forks. I put the while loop in and it does one at a
time..
chad
On Thu, 2002-09-26 at 14:28, david wrote:
> Chad Kellerman wrote:
>
> > I have:
> >
> > foreach my $usr (@users) {
> > my $
Chad Kellerman wrote:
> I have:
>
> foreach my $usr (@users) {
> my $UsrPid;
> unless ($UsrPid = fork) {
> while fork {
> do stuff
> exit 0;
> }
> exit 0;
i don't understand why you need another 'while fork' her
D]
> Subject: RE: fork exitting sub
>
>
> James,
>
> The script is too long. I fork because I tar thru ssh which uses
> memory. So that server I am on doesn't go done because of memory
> consumption I fork each tar so when the fork dies the memory is freed
>
James,
The script is too long. I fork because I tar thru ssh which uses
memory. So that server I am on doesn't go done because of memory
consumption I fork each tar so when the fork dies the memory is freed
for the system..
I really think I have issues with my exit 's.. I am going to
>
> James,
>
>I an tarring up different directories. Directories that may be in
> home or maybe in another location. The directories in home are @users
> and the directories in another location are @otherusrs. The thing is
> the directories in the other location might not exist.
> I
James,
I an tarring up different directories. Directories that may be in
home or maybe in another location. The directories in home are @users
and the directories in another location are @otherusrs. The thing is
the directories in the other location might not exist.
I read that before
> foreach my $usr (@users) {
> my $UsrPid;
> unless ($UsrPid = fork) {
> while fork {
> do stuff
> exit 0;
> }
> exit 0;
>}
>waitpid($UsrPid,0);
> }
> if (defined @otherusers)
> foreach my