Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: read with redirected stdin
- X-seq: zsh-users 28636
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: linuxtechguy@xxxxxxxxx
- Cc: Pier Paolo Grassi <pierpaolog@xxxxxxxxx>, zsh <zsh-users@xxxxxxx>
- Subject: Re: read with redirected stdin
- Date: Mon, 9 Jan 2023 18:46:31 -0800
- Archived-at: <https://zsh.org/users/28636>
- In-reply-to: <CA+rB6G+u0ePsa2Y_rUqzHsVHsk9SG=we334xa-PHgX1EREL8Mw@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CAP+y1xBo2fS--G8k+PbwEwJJx2d_s7ZxAJWrTNTJpE+MBB2x2w@mail.gmail.com> <CAN=4vMo5EJTiExmGxt2cxD2=_5PC0b=NCSEdZQRda+kvshg2=Q@mail.gmail.com> <CAP+y1xBGBDhmf3uQmxoTrkakTc_1=n54OtH3MC6eTdtsACJFiA@mail.gmail.com> <CA+rB6GJo8m1v-v1dwQXddhFDi9q-=Z0o5BsfX6C3-cWCa47e=A@mail.gmail.com> <CAP+y1xBJ=SJ08efizkY8kkCr2DZeLN1YtdcpyeobcVY1JD5LGg@mail.gmail.com> <CA+rB6GL2=RCjQvFz5k3SBJpRhr2oW582u5BRqXQ8n2_5D-TLhA@mail.gmail.com> <CAP+y1xCF5QGKaO4afGnkBapiYGnnyuoN2b4zHnM_QZy5vAy+_Q@mail.gmail.com> <CA+rB6G+u0ePsa2Y_rUqzHsVHsk9SG=we334xa-PHgX1EREL8Mw@mail.gmail.com>
On Mon, Jan 9, 2023 at 2:47 PM Jim <linux.tech.guy@xxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author