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 13915 invoked from network); 26 Mar 2023 17:05:30 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 26 Mar 2023 17:05:30 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1679850330; b=WNAYd/wjNDnBmiB0eQ/llWpfxteRHQKVy/iXlObPYZE2DuVmDmHlN7huo2JSaEhfq7mb3zrXQF M+YjjFjP7j1Tz/hd7pXU2zVbaKKnWDV8SGz37tja9bPH98A6u8dEpLomwx7AUe33BPcA6gr+gK LT0u4CCZPMnQJ2axtruFRbqknLN0FHtUIxppvHiEN0z0rV86HWW/kDYAlNjnweWWLQufEOjRR9 K6smlfwhBJcI26JEXeR4hkNzRB8mGFavzIOAic4GEp05F7Knb+RgvNEXzOuKXtMcwYOhi0EvVQ doSfvDZgDuQBsBAxL7gIdYTvmoYK/07b4GuxGCAWgMOVlA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-pj1-f49.google.com) smtp.remote-ip=209.85.216.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=1679850330; bh=0LJ2ruFYwEoGXQBY5fQhDP77ANE/3yvEiSEhyWcTO3U=; 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:Reply-To: In-Reply-To:References:MIME-Version:DKIM-Signature:DKIM-Signature; b=HHJf6cgkmaN+Gk7hjrQucllbWJS6cqjl6XmDWi4qx7rPCc83ojRqvws+TmTCFg9VA+3M69NGUq 0FYO7NiQhvk8q9qY9AahtPBcGKyyQQvyMHO/nYNr3tVA1ebutUHATAzoFR1dzByrcjalx46pU9 hI28WzLdmMMec8gHafsXHh0GFsjjrIi9zBr5l2uAgt0mdM52jxhDocKvU91N5MRlo8KBy6QDUr RnFAkaHbH7YpejWnNwVJUrth4EQEg8FqEr4G2qJxPcOJAxxU1vh48Xls/YyckM386im3xOWF3R L0tC4PM68muJyGYfBDcz/bYPIatmhVyxkYz28wu7Qb2qAQ==; 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:Reply-To:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=Nnp3uBqZX75szsHOrUQtpN0GFhOd9HWMkhYo+BpUhnY=; b=NXnEGoS1X+jkffBtjpxhELttJD tes5LOdikhJhZ1c7UuytABCh/+24+lKROkzNB0EdOJa9WjbayB6LgwMFL4Qe3LY8t0Qjj8qVoPDbL 7SyHQFKTImJSPwT3F3yqhe4TQcUFmPJNKmnwhOkXCUvvOjHfnnxyLZX7B6FonorhWMIgTUoyKaI1w Q6mNUDkLSkObOsoGpkBa+wYZ9WVQohfiJQQUsozqcudJfPgmMIQCvsO4teMcZUrFYDrOwnRspYYgA Bfcy8hSbHuco30Ee3tTVDqXh1uA0SpQ6DI21M4hq34kpRxlUAB/8S2wjwyO2H+wWZTTofI7EP0Nad CZZzpW1w==; Received: by zero.zsh.org with local id 1pgTo9-0009wD-Mn; Sun, 26 Mar 2023 17:05:29 +0000 Authentication-Results: zsh.org; iprev=pass (mail-pj1-f49.google.com) smtp.remote-ip=209.85.216.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-pj1-f49.google.com ([209.85.216.49]:51023) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pgTnW-0009EJ-31; Sun, 26 Mar 2023 17:04:50 +0000 Received: by mail-pj1-f49.google.com with SMTP id d13so5694158pjh.0 for ; Sun, 26 Mar 2023 10:04:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679850288; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Nnp3uBqZX75szsHOrUQtpN0GFhOd9HWMkhYo+BpUhnY=; b=iRAGyOoo7miAhY+eebM+m4MNjRoxeC6JMCTS6cH7EP3NU4xeJdF3i6rGpnDNP5VvRF QwLLhv4zlNjAWPkj9ow6NyegiaydoHJBFQCH/vXf3Hoo1iBMcuJ0cREyo8CNdRn08xPW bPvaFLC1597Yy0YbXkQeOe/1y2FP0NR1jhrWyu9EdTLryVjGx0NPbWo6W84d2/haxuS8 Tj5CkgQgmt9iyEcEEalKbEErK2i9usq6uiZsxQZE1nL15wp4H2J5YPCo6zWMq/FDnHKm grM4uefCKUA6PKTN8SJfL7QCykfkZLtKw5XdCs835U7Y9OboXZVUZAKJ4fJYVOp3d2q/ NIEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679850288; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Nnp3uBqZX75szsHOrUQtpN0GFhOd9HWMkhYo+BpUhnY=; b=C222QIBLMmjULDObSX9ljxQEnPixmYh3mzcbUceRBHMYScu1G/qJ55whQBWkah+GRh 7rZL7926YNetxnhxM/aO6mIHLDzno0k9i94qOwQ8iESzq4/7V7eFeSUGQDm/IcHKuTFd N3pdZdPpA4FxkR696Utot2w/aL8A77luO/JNwhx3Zfe99K2UirEBv3vnDcdvkMDtKFFG ur7oznMAsx/TKkmQj4vOtI2ozzPwNM69A37JkfFKlREKhEj21ylAfbBwt5MDuwsu3yFM 3ONlLZiBDAC+mv2T90dYpQ2k9fy98kF/xXlPcPaa62K1P70LARaj3g4t6pmxDnmKkvQn 3tmA== X-Gm-Message-State: AAQBX9eqqr4UtDEedLd00RfQchXkem45s3UV4EFE9YcwCvBSOHA3Df/0 P5SWV8wM9NYCrPpjC/XBZ6mMNAkDe2tKE/ldQwmfcMOv/9s= X-Google-Smtp-Source: AKy350bPL2tGEqyuQmEOLD/nVd8B5Gq5t6/gdgOLhutZSCrtwxtoex5XBxvyn/9q9cIXfIHN/W+NB7Yc3MxvoFVRcOk= X-Received: by 2002:a17:902:bc4c:b0:19a:f9d9:28d4 with SMTP id t12-20020a170902bc4c00b0019af9d928d4mr1513136plz.3.1679850288410; Sun, 26 Mar 2023 10:04:48 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Reply-To: linuxtechguy@gmail.com From: Jim Date: Sun, 26 Mar 2023 12:04:38 -0500 Message-ID: Subject: Re: strange interaction between read command and pipe to less from function To: Roman Perepelitsa Cc: zsh Content-Type: multipart/alternative; boundary="000000000000b775ad05f7d09f1f" X-Seq: 28985 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: --000000000000b775ad05f7d09f1f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Me again, On Sun, Mar 26, 2023 at 10:49=E2=80=AFAM Roman Perepelitsa < roman.perepelitsa@gmail.com> wrote: > On Sun, Mar 26, 2023 at 5:28=E2=80=AFPM Jim wr= ote: > > > > cvt_256_colors_2_rgb_hex_fmt | less > > In this command both cvt_256_colors_2_rgb_hex_fmt and less are going > to read and write to the same TTY. This won't do anything useful. > > Perhaps you don't realize that your `read` command reads and writes to > the TTY? What do you expect from running it simultaneously with less? > > Roman. > Now I'm totally confused. A bit by your answer and the word 'simultaneously' as I thought the function would run first then less. That set aside I dug back into a previous function I was working on that used the same read statement= . And yet that function when piped through less, less worked as expected. Bot= h functions did 'basically' the same thing with a somewhat different output. The one main difference was I had done a few checks before the read command which included this: V=3D$(ps -o args=3D $(ps -o ppid=3D $$)) So I added it before the read. Now 'less' responds as expected. I hope you are not as confused as I am. Especially as the command is run before the read and not after. Also removed the sleep command. ???? Again thanks for your help, Jim --000000000000b775ad05f7d09f1f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Me again,

On Sun, Mar 26, 2023 at 10:49=E2= =80=AFAM Roman Perepelitsa <roman.perepelitsa@gmail.com> wrote:
On Sun, Mar 26, 2023 at 5:28=E2=80=AFPM Jim &= lt;linux.tech= .guy@gmail.com> wrote:
>
> cvt_256_colors_2_rgb_hex_fmt | less

In this command both cvt_256_colors_2_rgb_hex_fmt and less are going
to read and write to the same TTY. This won't do anything useful.

Perhaps you don't realize that your `read` command reads and writes to<= br> the TTY? What do you expect from running it simultaneously with less?

Roman.

Now I'm totally confused.=C2= =A0 A bit by your answer and the word 'simultaneously'
as= I thought the function would run first then less. That set aside I dug bac= k
into a previous function I was working on that used the same re= ad statement.
And yet that function when piped through less, less= worked as expected. Both
functions did 'basically' the s= ame thing=C2=A0 with a somewhat different output. The
one main di= fference was I had done a few checks before the read command
whic= h included this:

=C2=A0 V=3D$(ps -o args=3D $(ps -= o ppid=3D $$))

So I added it before the read.=C2= =A0 Now 'less' responds as expected. I hope you
are not a= s confused as I am.=C2=A0 Especially as the command is run before the
=
read and not after. Also removed the sleep command.

????

Again thanks for your help,
<= div>
Jim
--000000000000b775ad05f7d09f1f--