Zsh Mailing List Archive
Messages sorted by:
Re: check if coproc has output
The pid for the coproc is easily obtained with $!, but when I tried to use it in a trap I couldn't kill the process, maybe because of the bug Roman is pointing out to. I will now try to recreate the problem with a simpler example like Roman asked so it can be better understand
I've read your post briefly and saw that you need to terminate the background process. I recall that I was doing it in configure-wrapper that I once wrote and that I used jobtexts. I do recall that it does contain entry for coproc, so you could examine it in a INT trap and send a signal to the coproc writing process.
I did again the search in the manual and now I found it, maybe I mistyped the first time
where do you suggest I try to print this array?
Are you running zsh 3.0? That would only explain lack of following in zshall:
This associative array maps job numbers to the texts of the command
lines that were used to start the jobs.
Handling of the keys of the associative array is as described for
I'm sorry, what is $jobtexts? it seems an empty variable to me and doesn't appear in zshall manual
You could get pid from $jobtexts?
I realize now the subject doesn't reflect the final version of the mail, sorry for that
Hello, I want to populate an array from a long running process, something like:
long_running_process | while read line
problem is, since long_running_process does not continually produce output but only some times, when i try to interrupt this pipeline with ctrl-c I have to wait until it produces some output for the process to terminate (because, as I understand it, when it tries to write to the pipe it receives a sigpipe due to it being already closed)
I have tried various constructs with trap and even coproc to be able to intercept the ctrl-c and send a sigpipe to the long running process, but to no result.
I wonder if someone has some solution to share for this problem, thanks
Messages sorted by: