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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 26922 invoked from network); 10 Jan 2023 02:47:38 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 10 Jan 2023 02:47:38 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1673318858; b=H8bhUOYX5Kk8cUpxQt2CgCoXSPdYippH7T9XSbmZQ364KKX5FI38nc/PE2tfQ3Gw/Jjm9oCP0R 0mOhfMMXNNJYGob3ceu8PfNia2j+LDsUOS/5EGGcbGK2IYaXpRVOZs33C6zdP+3dBQLkJNmYl9 l9wib9P8tb+QQ+eBP70VUEcTXG9yQYVFeXz/CCMbgRdpCzEGfFh49CpylpveQW0N/dezeK085b 1PuYeJSfXvx8q6iextS8qGdn9LFv87pmzHjDS/Lmw8Ucg/2geXVUFC4oVS00Gr7ej0aOesXaGI oKKSykZEY8d+tUj5+AgHFj4+sWQQA1OnE9YWVO1XctGRHA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f50.google.com) smtp.remote-ip=209.85.218.50; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1673318858; bh=C6ijNP40LWFPQRTjv6icxiMyW6cxFGOtpqfxz6zi2Oo=; 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=bTfuH9iDdACykiIJWdFLBFicKXwG8WMet9IgTJUzKaAu+d/xJSh+HA6enFLFACPA+Nt8DlJekB YpmaWaCGXwdvJo3P2KyqGgvYCE2Sgl0ZxwCqZdSZAhkwq0j+WITXfDvqgqwI6cEXDZzcAWT0pv YK+a9FxE5VC2t5TlsCvJ1WsrWSKIjkvOosR5IExBO4825yhQi+m9awnU7CVkjKLisn/be+i6la fyS57aUpmOg+81jV4PRumIpOz9d67mSXVHH2dZCsnxIqly5Q6X10Xj5yAogNvXuKXn0EI5NMAP yCpTgrtvCenymf9dPol90Lhd2X62MrmPCZxyc4Ac8ZG0pw==; 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=NXfkERabmF6srsksRwVKpvtyIajhNsjnS+4omtl4kIU=; b=J544zylXs7KByJqHpW9Gnoixen sEbIaiq3plkRiHGhhgi6YsTEJXy13gN5JNjdQHZedb+fMFPYm4nqez+bx8dPzFuqoUMvyiKwPXp6z jse99gDxt2/OPlDpiMI6wiQCEeQ2b23ais+0QLR16sZDSnQsgVfOGbB58LWkyn/LPfZqC5j0RI5vD /4Fgbd3Nesmt/CUgZEjPEkydOz1Fo33W8O+sPmSE1Y4adzoaF7DbITlps2yicGXYBryU6JJMffpT6 6OXlMfCCpmWh/CI5sGVREMpy+zXiqvdRhZiLRih5A/vgfWfLNgXNi7Itizp2bnLKE04YcYFYZRk54 P1gtpJPA==; Received: by zero.zsh.org with local id 1pF4fo-000D1H-3P; Tue, 10 Jan 2023 02:47:36 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f50.google.com) smtp.remote-ip=209.85.218.50; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ej1-f50.google.com ([209.85.218.50]:36701) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pF4ez-000CIu-UX; Tue, 10 Jan 2023 02:46:47 +0000 Received: by mail-ej1-f50.google.com with SMTP id qk9so25126667ejc.3 for ; Mon, 09 Jan 2023 18:46:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.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=NXfkERabmF6srsksRwVKpvtyIajhNsjnS+4omtl4kIU=; b=HfrkfMMUujEy3LXVR/VqlhBxr7uxSMixbEOSswSBsnCRhEUBzML2TRu+2YODfF4+mi z4kiW4n9XF8azkug8mCql/h+q1AEy/LDbojlAhqiOCaoyvpxCZr5GaoJ6F52AzMSI1rR FeM62q/KwRZNpMfMrlNWGXT8zDWfgMXxIQo5m2i6eJesclnSAzQv0u5jHz5F7d+CAY4d /YiF1dqS8Oc43hQQJECGyDuA9hgp5fmdG5Er/ZzHCERCuBtHIJqR+nWfCb4sVFarNwZ1 +ETrEnEToA4AWyqLiD/5KfcFOU1coXcUPNhflRb7/hX7FyUjnvEE6sUIRl+fiiZqXpmk Cpzg== 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=NXfkERabmF6srsksRwVKpvtyIajhNsjnS+4omtl4kIU=; b=2SrU7CjgCpDbgpKrK0lYRMarRa0pP1a+cSOzUvrgJeeabifOmtWQjEn6RjRoYwLDM0 AZ/S6+OWAr9y+UVGVzwpy5J/Cws1mfZzxLpmA/tnw+aLeDU9NsfXUGHJjvkQKwnMBgwb PuZDJPCb9aE6Nc58e8+Gt/bWk0l9xaNBD7XS+IfVeV9zLg7wvl1KLETT9PiqVo1xlXsD ZHHqY/OK8yK+WWIIKxREzbaeD2LKGnSv9sMTUR0xYARCeqUPQwTRI0RzempGSnW3cg3h /DFlc1AwkidDznzNxOnuFhB/H7X5P6eB0r8qC4O3KKlIepHkkKzZDj01SSDZqXawhlUh pCbg== X-Gm-Message-State: AFqh2ko2kveY2UGX+/qgB0EyBUgHe+gXOXnFCoQqYNr3qR8v0C3HNBXo uEymWhdrsZCS/L67dpSy4+atSh4vnUrZsmREoLRFwA== X-Google-Smtp-Source: AMrXdXvH/ppvaIqiKPF5c7r0NyYzM2oI9lroli3bslCQQK0tsxzJNE69d78EL8r1KOBjp4jR+8SIsW8i/siR92KTcKk= X-Received: by 2002:a17:907:8e92:b0:846:2f3b:13af with SMTP id tx18-20020a1709078e9200b008462f3b13afmr5749415ejc.214.1673318805454; Mon, 09 Jan 2023 18:46:45 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Mon, 9 Jan 2023 18:46:31 -0800 Message-ID: Subject: Re: read with redirected stdin To: linuxtechguy@gmail.com Cc: Pier Paolo Grassi , zsh Content-Type: text/plain; charset="UTF-8" X-Seq: 28636 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: 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