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=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 19452 invoked from network); 10 Jan 2023 06:05:15 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 10 Jan 2023 06:05:15 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1673330715; b=eHlWkZjVmdHflGwxwNsKmExHcqLKexAAfWNGJIEsG9qBGAUCQyTH5FQ2gebeH6QDdCaClT2crf M5NX6+8Y5npu+YsJ2OwElXRkyk3p0a6D8KbYT0QYv8XduqtyIV0jSoItOOH92l/UAgIw7FxbaK +AY0tT4/nwcfYSxvsoYptzFLg1VRY/blFYO5sl9BYaeKHfIks0AW0pBHOHwJrWk0EK3b/jUSXZ JwrRpZOYT666D0xfYdBkqfNS0XBRCp2ggvExfzeQNLRkfCIM11CAxvFnzWdfHS26VypqJIM1xr 6LxaL/wGznSzki6twDXMWrochvxs7tdWBB0J50SM8MNbVA==; 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=1673330715; bh=XscVxHy4Eq+ftec3UNTTBH24VTGwV3kII8FKSieLcTY=; 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=PNGx0qxy2/tcP3h9gm6G5qyWBbNe8haYBjccYKYopJYQfS0LPkMmgqGgb7Wt/fZ4TvnOrfEzMY WdXm+IWlubte3JiRSKdEtCuVFrlSsSDs6Mv06Ip+ni5EVG1cc9cv5OPeINRh6p8UiD09bqH1+J kc18UcqAYN6rgCA7KUlJV+HvFBWtNUHVvSXrZAXwuOcQY3bkjlMjCy3KqcZXf5lpAdEKsqodwx qLgzkbBAKtZyiYEylaghLP2UI4qs0fxvNt9rNXh7RXnNLVGzsdk4nruUpHywGYvJYVA7vm9Mqo BGS1STR6UuA6SVOeovkKeWfJVtQRqqtrwtwMa0eIF+8UUg==; 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=sZtCDCHjkOQrEqMRuXAsRQNf+drzM73WERHraYXcXMA=; b=E7BFkzaRVTq5NFdOEmSIKXQzde DE2bCOMdiY3RKzTEew375zEvFcNwavU4WV2WgFdp1V3kIQ4w3zFBE3dsAxdNgAD0FwrKSauHgx9zC /MA7OWq5TBMYONdfwaYtYgvnmO1skmarm4F9NRg/u+ekLtfDb0s2xGvmyWwSEdmKY9iTqrNR7/shl 3IZZ4S79GUwkv7Y9Exs+Byu3WIvTlhyvacQLZbyrw6e6OTKAgm5dXqF0tgtKHkHpayr24quiffJEK XFrMze8oFDQuxaDapvm4+F3hBMFr7LNacD1vHsABN/QbwWLeJ1OD/Kom6esR1uEtlxSFtQjgz6cTp kuaC9CEQ==; Received: by zero.zsh.org with local id 1pF7l3-000JS7-TV; Tue, 10 Jan 2023 06:05:13 +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]:44839) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pF7k3-000IkY-FY; Tue, 10 Jan 2023 06:04:12 +0000 Received: by mail-ej1-f43.google.com with SMTP id ss4so18615864ejb.11 for ; Mon, 09 Jan 2023 22:04:11 -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=sZtCDCHjkOQrEqMRuXAsRQNf+drzM73WERHraYXcXMA=; b=iYWtU59G4l19KSPsykLadWWBoQgVoZfFztzNawaXj09rDx3kITl7Badnf+fR1Uz0u/ x5gJcGz7sO08J61Mxe3U9h0Q0CAj3Qj/CaSYaWUgPyIREBrGFOgwMSHceVMplygW5SIK Ln3repfCrnDeZtlUPIzuKticKUR1GuKG+edszun5mohdvORSon/H2mcGeXVLSajVqem/ vMIYy7+JHUQUmxDXeqRxqED1Zro1QnMCegQAAyW0MUbOxtmOSDZ8fOiDw6nTrjT/DU17 +t/RBu2K92o5apmy3TawPyrsm3IKgpS24I6fq3f6mxiJjhVs8H7OmW/YEiGpqbSDZq2x PxwA== 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=sZtCDCHjkOQrEqMRuXAsRQNf+drzM73WERHraYXcXMA=; b=BrSzZE4YY1Jq6kAOKB4NWeSOYy6yoxNI5R7MvJPQ5FIFcMxr5/YiZHsm3do3PVodYU 4wRdVNFYh3oDzsLzzDA06zTn31u9g2ClDTxnUsO499JwH8GzdCFZdfm2MuV3U0rPwkfz /LBZ4mbVxtkDUsmXmAVgGfPEas6TQMvrIprZoupUULWi90kuXPAjV6jK2o542wPrFkRb M+D6OJBrADYdUtq4Nask5pDftzewd6OnHuAA1cYMD5fJgDck83YmHSj/d2j1+A1SED1j 4LmND3EriEYuq45hsvXgQDOpKA8BwVa6cwzlsDHyuma99WTU4LjLggXFykTdzwoCoUrN Ro0A== X-Gm-Message-State: AFqh2kqLX2XIOLrLaWpxeKCup03YAp6+vmHeuCFMNWemGedxBvK5IVEX FgutgzuzigyQ4DRvJIAqpURCrKW/mPAz4oZT+Jg= X-Google-Smtp-Source: AMrXdXu35OaYSSMFeTKteePJg1NqylZUKCCczFXOeujZNHF1JxsToF6GHZMm6+Dm5BwOv+xdRX5MDkyzihzBZE9/3MQ= X-Received: by 2002:a17:907:1116:b0:7c1:55aa:2e83 with SMTP id qu22-20020a170907111600b007c155aa2e83mr6920869ejb.361.1673330650782; Mon, 09 Jan 2023 22:04:10 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Pier Paolo Grassi Date: Tue, 10 Jan 2023 07:03:33 +0100 Message-ID: Subject: Re: read with redirected stdin To: Bart Schaefer Cc: linuxtechguy@gmail.com, zsh Content-Type: multipart/alternative; boundary="000000000000083ac005f1e2a722" X-Seq: 28637 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: --000000000000083ac005f1e2a722 Content-Type: text/plain; charset="UTF-8" thanks Bart for this explanation and the solution, I wasn't so sure how to explain what I was looking for because I was missing this mechanic. Pier Paolo Grassi Il giorno mar 10 gen 2023 alle ore 03:46 Bart Schaefer < schaefer@brasslantern.com> ha scritto: > On Mon, Jan 9, 2023 at 2:47 PM Jim wrote: > > > > I haven't seen anything that shows ttys pointing to a process. It may > exist, but I don't > > know where you would find it if it does. I just know that processes > attach tty devices > > via file descriptors on Linux and Unix systems. > > Although the foregoing is correct, once a process is attached to a tty > the corresponding descriptor can be closed or duplicated without > detaching the process from the tty again. All descendants of that > process form a "process group" (unless one of them explicitly takes > over as a new "group leader") and all processes in a group are > eligible to receive signals such as INT and QUIT and TSTP generated by > the terminal (usually by keyboard interaction). > > So Pier wants to know what tty is associated with the current > process's group, not what tty may be performing i/o with any of the > currently open descriptors. The simplest way to do that is to use the > coreutils "tty" command: tty < /dev/tty > --000000000000083ac005f1e2a722 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
thanks=C2=A0Bart for this explanation=C2=A0and the solutio= n, I wasn't so sure how to explain what I was looking for because I was= missing this mechanic.

Pier Paolo Grassi


Il giorno mar 10 gen 2023 alle ore 03:46 Bart Schaefer <schaefer@brassl= antern.com> ha scritto:
On Mon, Jan 9, 2023 at 2:47 PM Jim <linux.tech.guy@gmail.com> w= rote:
>
> I haven't seen anything that shows ttys pointing to a process. It = may exist, but I don't
> know where you would find it if it does. I just know that processes at= tach tty devices
> via file descriptors on Linux and Unix systems.

Although the foregoing is correct, once a process is attached to a tty
the corresponding descriptor can be closed or duplicated without
detaching the process from the tty again.=C2=A0 All descendants of that
process form a "process group" (unless one of them explicitly tak= es
over as a new "group leader") and all processes in a group are eligible to receive signals such as INT and QUIT and TSTP generated by
the terminal (usually by keyboard interaction).

So Pier wants to know what tty is associated with the current
process's group, not what tty may be performing i/o with any of the
currently open descriptors.=C2=A0 The simplest way to do that is to use the=
coreutils "tty" command:=C2=A0 tty < /dev/tty
--000000000000083ac005f1e2a722--