From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 3401 invoked from network); 19 Jan 2023 16:33:57 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 19 Jan 2023 16:33:57 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1674146037; b=TyxgVaDLwVAPYI0euzsUWDwy9yx1io+UBJNs3wjJfACQf2THP5A0SUiOsbCEKlVLOSMDKEX35g UxPd5JWx66pPxcxkJvDNLBe17Si1qcD80Jo2drLljL3NNOhmIdHBHKCB5HoUNvtftttkEi4X+K OFfjwbmlSw/ZZVHxAVBCNzK1WI5+TTYOPjifZHlbt8/lZN0Bf9ozNpidHAnw7e+gmXf5JZi+QP 0UlFWizZA02a9fT3HhKDqHuZHcJ7wAqzSUJ1zes1iUKjsJ6cCXge1jVGiobX/8qWxJA2rY7pTe MX0UgZxYRSQ5lOIrWIu5ZvNGLLYGYh9dPqxusq/2iWMH7g==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f43.google.com) smtp.remote-ip=209.85.218.43; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1674146037; bh=r8m8u56OTlC0khqTzw1M6yPfVZ3aAE07rqu9PsywEqs=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=jfNocw1CnQj60iJ60HKJyGOTnEuyR+s1QdzSz0w3L4aWXyHfbtneUeaU8I9IRzdyt48F3Sp9su afHLEkYqGmujubL1rm3nh8l8RXd0HxKiOPUNesJLQa9cUXSFHjq/THUvkbCVKLpnwvk6Yse+se oMGMqM0PjdO5JdoWEsT3e5cV4KdHQuCXFiQUDoq9dWfNHWMc2oY9Tr+L5oSavNKozWX/m9OvCj YENEF6czmWyQ/aRDUeMS+2oPoIqrBYNMhBXmUptFtDfWwyPC7cHkHGfQABrAd73voETbr9eGGe tVZCI1YLpA5LIKVkeJi22hPzSGLIvT9vrCFI2qF9EIlVDg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=pzrHzPZcCdgDkUPC8pOVcGdYzwYzyZV4pvKHIT74mCQ=; b=LTd6jlOSCboFewMoHUwFvShJ3C hEIUW0fHQF0NBZPeCd9NEU3G60w0jZ93x/npmlhcd2cz1fekhs2Ws1MisXtqJx8qa8Fb4nj8OD8Yx yvQhs7xn/+/cSlW59DrEwGlhElRL8Hy1nS1844tUka++NmpoY0UqbTYyIe+a9B/QP+SKkoSMea7d+ a+Svh1e/sl1IPjuJQx1fiXZ2VJELJKSo9x4PT/YpVhn57+J+qzPUHHlFbV+NpfO//wcpgehN8NEaB rY1TH2Mjk62e1i7M7XznUTUx9eBD10KH+H8PXRkW1dDml4rhaGicocRrfvRWSQYoFXdDLsI5EFXkh N1hOtXKQ==; Received: by zero.zsh.org with local id 1pIXrR-0007SI-FM; Thu, 19 Jan 2023 16:33:57 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f43.google.com) smtp.remote-ip=209.85.218.43; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-ej1-f43.google.com ([209.85.218.43]:41709) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pIXYT-0002zj-UF; Thu, 19 Jan 2023 16:14:22 +0000 Received: by mail-ej1-f43.google.com with SMTP id u19so6944968ejm.8 for ; Thu, 19 Jan 2023 08:14:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=pzrHzPZcCdgDkUPC8pOVcGdYzwYzyZV4pvKHIT74mCQ=; b=iR2Up7PxRp3yUIe+19lvHSqanODu55Ni1lvInim/zXDMxvg46/XxGyPCTCqHfZ9Q0o qC44J14jLhq14WsK0uHLZaGV+V3o9shNh9icwgQi3/sAJfsY4O/RyySmETlid3v4aqdL lqpO3GqHJ3srHGBMijhgGEE0byj7qsFKayQFTRtQ8PT7Fd3DuBVAk+QegcUKozr4GAd8 wlpLaOW79xcOOV6qFfHg0VpRpCmDiV0HwNC4Qev1CkrB5xLkUzg8RsMrg1GBrEOWn6Lq SzqLX1TEq2rKNwxxndIvWUpGMeKJqi5PUKjAw//3tjRzb/MfMIC39HjPLDKk7F1mKwR5 zF7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pzrHzPZcCdgDkUPC8pOVcGdYzwYzyZV4pvKHIT74mCQ=; b=zzp3XFRwQWpfRBJ3fRZhVEWHZs4T/6eYfks6HwBYOQCIE3Prah0onzbEVXJfDfXRJW 1I+gDX0UWOiHjwC10xEo2BiLQGdwqtYXvWjAdioILZC7wUtbRLVALoGL6rquU22NAhiP MFcnvFFyraBQ0s9g0YvQHMdlUglpG1RvhpmUKwm2lpuWHa+hVT7qu2WKlzEMYePogyiP MinXwUPkV8OSEjJfz619/Jm51QYjY7XdakmiVJAizJVCXRPAwia0TfYFUPB6/bzcQlrn sY6tBFFdPY4nkhS+8m4cq4u+dMjBUl8M8vvmZ8Xwykp9vQT4FseqAFFSuewvEql6t6iP //GA== X-Gm-Message-State: AFqh2kqK1MdxZO/6SuUbkdVxYit04TwCJhorQKMwZyowB3ERepvlb59Z JaWlZ8anazUYoui4hWn6PSXjn90iTjQhe0K1M3U= X-Google-Smtp-Source: AMrXdXtuv0P1ljSLEFQvum9mpHRKOjbkVjNNFr1ezPWdyZzKWQPwBy30L3efwHJW0ZxRa8uGjR3c7igsApGUlYCsjEY= X-Received: by 2002:a17:906:2291:b0:85c:579b:7506 with SMTP id p17-20020a170906229100b0085c579b7506mr718455eja.646.1674144860272; Thu, 19 Jan 2023 08:14:20 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Pier Paolo Grassi Date: Thu, 19 Jan 2023 17:13:43 +0100 Message-ID: Subject: Re: check if coproc has output To: Sebastian Gniazdowski Cc: Zsh-Users List Content-Type: multipart/alternative; boundary="000000000000b2fe9f05f2a0390c" X-Seq: 28670 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: --000000000000b2fe9f05f2a0390c Content-Type: text/plain; charset="UTF-8" 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? Pier Paolo Grassi Il giorno gio 19 gen 2023 alle ore 17:10 Sebastian Gniazdowski < sgniazdowski@gmail.com> ha scritto: > Are you running zsh 3.0? That would only explain lack of following in > zshall: > > jobtexts > 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 > jobdirs above. > > > On Thu, 19 Jan 2023 at 16:08, Pier Paolo Grassi > wrote: > >> I'm sorry, what is $jobtexts? it seems an empty variable to me and >> doesn't appear in zshall manual >> >> Pier Paolo Grassi >> >> >> Il giorno gio 19 gen 2023 alle ore 17:02 Sebastian Gniazdowski < >> sgniazdowski@gmail.com> ha scritto: >> >>> You could get pid from $jobtexts? >>> >>> On Thu, 19 Jan 2023 at 15:43, Pier Paolo Grassi >>> wrote: >>> >>>> I realize now the subject doesn't reflect the final version of the >>>> mail, sorry for that >>>> >>>> Pier Paolo Grassi >>>> >>>> >>>> Il giorno gio 19 gen 2023 alle ore 16:32 Pier Paolo Grassi < >>>> pierpaolog@gmail.com> ha scritto: >>>> >>>>> Hello, I want to populate an array from a long running process, >>>>> something like: >>>>> >>>>> long_running_process | while read line >>>>> do >>>>> array+=$line >>>>> done >>>>> >>>>> 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 >>>>> >>>>> Pier Paolo Grassi >>>>> >>>> >>> >>> -- >>> Best regards, >>> Sebastian Gniazdowski >>> >>> > > -- > Best regards, > Sebastian Gniazdowski > > --000000000000b2fe9f05f2a0390c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I did again the search in the manual and now I found it, m= aybe I mistyped the first time
where do you suggest I try to print this= array?

Pier Paolo Grassi


Il giorno gio 19 gen 2023 alle ore 17:10 Seba= stian Gniazdowski <sgniazdowsk= i@gmail.com> ha scritto:
Are you running zsh 3.0? That wo= uld only explain lack of following in zshall:

=C2=A0 =C2=A0 =C2=A0 =C2=A0jobtexts
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 This associative array maps job numbers to the texts o= f the command
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 lines tha= t were used to start the jobs.

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 Handling =C2=A0of =C2=A0the keys of the associative array is = as described for
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 jobdir= s above.


=
On Thu, 19 Jan 2023 at 16:08, Pier Pa= olo Grassi <pi= erpaolog@gmail.com> wrote:
I'm sorry, what is $jobtexts? it see= ms an empty variable to me and doesn't appear in zshall manual

Pier Paolo Grassi
<= /div>


Il giorno gio 19 gen 2023 alle ore 17:02 Sebastian Gni= azdowski <sg= niazdowski@gmail.com> ha scritto:
You could get pid from = $jobtexts?

On Thu, 19 Jan 2023 at 15:43, Pier Paolo Grassi <pierpaolog@gmail.com= > wrote:
I realize now the subject doesn't reflect the final versio= n of the mail, sorry for that

<= div dir=3D"ltr">
Pier Pao= lo Grassi


Il giorno gio 19= gen 2023 alle ore 16:32 Pier Paolo Grassi <pierpaolog@gmail.com> ha scritto:
<= /div>
Hel= lo, I want to populate an array from a long running process, something like= :

long_running_process | while read line
do
=C2=A0 array+=3D$line
done

pr= oblem is, since long_running_process does not continually produce output bu= t only some times, when i try to interrupt=C2=A0this pipeline with ctrl-c I= have to wait until it produces some output for the process to terminate (b= ecause, as I understand it, when it tries to write to the pipe it receives= =C2=A0a sigpipe due to it being already closed)

I = have tried various constructs with trap=C2=A0and even coproc to be able to = intercept the=C2=A0ctrl-c and send a sigpipe to the long running process, b= ut to no result.

I wonder if someone has some solu= tion to share for this problem, thanks

Pier Paolo Grassi


--
Best regards,
Sebastian Gniazdowski


--
Best regards,
Sebastian Gniazdowski
--000000000000b2fe9f05f2a0390c--