Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH (?): Re: suspend while loop.



On May 19,  8:30am, Bart Schaefer wrote:
} Subject: Re: PATCH (?): Re: suspend while loop.
}
} However, that doesn't affect 3.0.8, so I think I'm going to go ahead with
} 11461 for that release (unless somebody hollers today to stop me).

Here's one other oddment:

zagzig% cat | while read line; do echo $line; done; :
^Z^C
zsh: suspended  cat | 
zsh: running    while read line; do; echo $line; done
zagzig% jobs
[1]  + suspended  cat | 
       running    while read line; do; echo $line; done
zagzig% fg
[1]  + continued  cat | while read line; do; echo $line; done
foo
zagzig% 


According to Etc/BUGS, the `; :' forces zsh to fork before starting the
while loop.  So in that case I would have expected ^Z to work, but it
doesn't.  Following the ^Z with a ^C appears to background the job, but
that hasn't really happened either; the while loop is not running, it's
already gotten a failure return from read.  Is it sitting there waiting
for "cat" to die?   (Which cat does, from a closed stdout, I think, as
soon as you give it any input.)

I'm still not going to try to deal with this for 3.0.8 except to mention
it in BUGS.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



Messages sorted by: Reverse Date, Date, Thread, Author