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 2357 invoked from network); 19 Jan 2023 16:24:45 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 19 Jan 2023 16:24:45 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1674145485; b=bfG8KDLG63KrvZSnQmxq/5uBsJ+zMTzawnyI3AAU76PltcpmwtFVM3HGGASCUYJT4rVlecQdRx qiBaLp5c6ct3afobZjDRxc/MXFifRsd/D5q+bWM9Cks/luElI3LUfnCGeNs4qsEw6YYG5BVacI iXlVGbwtEpkFx/sngzZMaxw+do9PeMC9XrZfl5+w9t0kmMeFWRuTepVGTR7TSjhw7CEOSl9fBU OpyxGj4twHcfDDIk5yXinMN8jw1QtId2ODQJG6+VAvLQJ4bvqi3kntLWyTSr4YnEl3tOgkWcmm /6q4mhiIwShlfsAT9jIgLmtXDpqCr5VfP42NORQbHcLevA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f49.google.com) smtp.remote-ip=209.85.208.49; 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=1674145485; bh=nyf/94I7jzpH2Q6asxKFzP1qU/5UOtivUXb9EWjnAo8=; 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=sJBUZBkQF/QJzAQDrR+JxtVInlUkGJDnpCZUSgA5UU4vo3vYRLbfUzt6FiByLLQGbS9gGX9mK9 ZJRiugvez8I6gK4B+WAQv3etJC7/hlW+ZjRLJiS1Dk5A3DmQzVg1ZersevtSecZ11pX++A3PMy kcIuCxL9kZssTXUvo+dHiElmxfuJA4pQXi3cMINwJEDNlric44wP3Ij9oXSLu4RhQ2pdVKDU8M YyyXbm5dy9TQM6V5U8NIy1eWnjY+mAo7tg45cjgF94dJQKvUvB24ZNo+hS55TCFh2Q8CyykjEz MtJXH2piG1obsTBBCq9ZTcoXWFcbtOkQljwwZPlkG6L5mg==; 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=bNJZBTxpBIDNTMEtMsTJA9/cS68UvL/vldsuiiQizck=; b=owzOogvZCxdnfGPO60401y8UCi x9E4GVWxoHSLuL6OR0OhqrrDf25Xpzml5hPxyMFYCSmT7enjEWzdsv2ZI5ttjVXx+xipMCfy9hmT2 LNK74N+33Ug+AynWRBozChxZZSEfrCjTpvPCoK7OvMjwoBqrcBqotDcr5T+o0PqWaKhKKKliPlD0u Pxswt87iO9I63qBz3Z3M1E819Ux1z5SDu8MFQK78z1BXJngZFPIAuenkS954hmG1y621W9dpqBRCR Iv6qolxZhEMCErtfDlnShFdJZFDhaoJijaQJpkYU3Du+lv8LUJp5YU279nyRXGJqLf9eIvHqgz3kl YSy6/o2A==; Received: by zero.zsh.org with local id 1pIXiX-0004xO-Cf; Thu, 19 Jan 2023 16:24:45 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f49.google.com) smtp.remote-ip=209.85.208.49; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-ed1-f49.google.com ([209.85.208.49]:43897) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pIXSy-0002M0-9w; Thu, 19 Jan 2023 16:08:41 +0000 Received: by mail-ed1-f49.google.com with SMTP id x10so3421925edd.10 for ; Thu, 19 Jan 2023 08:08:40 -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=bNJZBTxpBIDNTMEtMsTJA9/cS68UvL/vldsuiiQizck=; b=POfROn1R+NQRHrQnUXzInbO0AzT7Ob9Sevjb5nkhvvyNJ5a0MABE8fk5rfrwKdlxKM ptwkzZ+jWTz0+1TUHcvcqjARabMX4qfsH3JKRDjxvXgZA8bI8TOVs4pQO3GkB7judLyY KkZotYbK1op9Utapx0oTMiNspJML4S6JFIXDS4SRpScydXxa8TJJFuE+agWrNbwnUL+3 mpM0eshPFS1b9hyHaZJ9QQuV9/5PCrRdlCurPa22OCcqsdNhWGyD6IT6tGNBOdCRspbF QzfapkA+uXH1h/q6Y5pZYTrArg8CDUyWXrWx8vHzpoV7BVaN7yGsgfxEYPmKaoof8F5C Rl0w== 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=bNJZBTxpBIDNTMEtMsTJA9/cS68UvL/vldsuiiQizck=; b=EMnSxbfDDaLzTofpdGjF3T2lIFVlIJO8PcRZJQSyPmK2VEZFylWflJzEsxFjzApdwL vZUxQOmkDTq2072/ebVIsG+qEqpYXwPFQ+ejZmMv2bbsRq35b6zy3lKgBDV03k2xfTlq QN2BDlOwX4ESmUkB3CuvLgDyIl9D4w1aGt+kGWQkf3moRl7+wEMV4cHXpY4iAngxk1Ri NooYeFqt5HKKuQIHhHtnw0S4dZH1VcppZ1z1elrLXiU3/PDq+tm+rQ3G80N0zf/9MhPY awVmRG4Z6AjI0JsRZZRoNbsfo7Lh3DUzuDnFy42bwaAlffVIfQWDGPxntKNK4+tEA9mO I4qA== X-Gm-Message-State: AFqh2koXsXHqKgCbJxdSL6yy4J5C39osgmz/J2tf2W7lvzzcWl8BkRr9 LwcEbPdy9glFY9jc1p//37DRRCWas4tgx9vUhYjPdCYyfRKkkg== X-Google-Smtp-Source: AMrXdXtVISgKBEHV03AzZiegZz7pQE/B8MuiYTOZmcg1AI9UE0M/3gN6UirpR9dzhnPkRRjef8T7ZFXjrXBZAHsJKaQ= X-Received: by 2002:a05:6402:1ca6:b0:497:6b55:a125 with SMTP id cz6-20020a0564021ca600b004976b55a125mr1207221edb.44.1674144519831; Thu, 19 Jan 2023 08:08:39 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Pier Paolo Grassi Date: Thu, 19 Jan 2023 17:08:02 +0100 Message-ID: Subject: Re: check if coproc has output To: Sebastian Gniazdowski Cc: Zsh-Users List Content-Type: multipart/alternative; boundary="0000000000006844b105f2a0252a" X-Seq: 28668 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: --0000000000006844b105f2a0252a Content-Type: text/plain; charset="UTF-8" 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 > > --0000000000006844b105f2a0252a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I'm sorry, what is $jobtexts? it seems an empty variab= le to me and doesn't appear in zshall manual

Pie= r Paolo Grassi


<= div class=3D"gmail_quote">
Il giorno g= io 19 gen 2023 alle ore 17:02 Sebastian Gniazdowski <sgniazdowski@gmail.com> ha scritto:
=
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 version of the mail, sorry for that

=
Pier Paolo Grassi
<= br>

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 runnin= g process, something like:

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

problem is, since long_running_process does not cont= inually produce output but only some times, when i try to interrupt=C2=A0th= is pipeline with ctrl-c I have to wait until it produces some output for th= e process to terminate (because, 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 ev= en coproc to be able to intercept the=C2=A0ctrl-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
--0000000000006844b105f2a0252a--