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.0 required=5.0 tests=MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 1190 invoked from network); 30 Jan 2023 14:30:55 -0000 Received: from minnie.tuhs.org (50.116.15.146) by inbox.vuxu.org with ESMTPUTF8; 30 Jan 2023 14:30:55 -0000 Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id EAC33425C7; Tue, 31 Jan 2023 00:30:49 +1000 (AEST) Received: from freefriends.org (freefriends.org [96.88.95.60]) by minnie.tuhs.org (Postfix) with ESMTPS id 72D6F425C1 for ; Tue, 31 Jan 2023 00:30:42 +1000 (AEST) X-Envelope-From: arnold@skeeve.com Received: from freefriends.org (freefriends.org [96.88.95.60]) by freefriends.org (8.14.7/8.14.7) with ESMTP id 30UEUWcd006204 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 Jan 2023 07:30:33 -0700 Received: (from arnold@localhost) by freefriends.org (8.14.7/8.14.7/Submit) id 30UEUVTI006202; Mon, 30 Jan 2023 07:30:31 -0700 From: arnold@skeeve.com Message-Id: <202301301430.30UEUVTI006202@freefriends.org> X-Authentication-Warning: frenzy.freefriends.org: arnold set sender to arnold@skeeve.com using -f Date: Mon, 30 Jan 2023 07:30:31 -0700 To: cowan@ccil.org, arnold@skeeve.com References: <202301300750.30U7oQTh013304@freefriends.org> In-Reply-To: User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID-Hash: 3IX522BLKDMHCNJFSQVEH3764REYBPCO X-Message-ID-Hash: 3IX522BLKDMHCNJFSQVEH3764REYBPCO X-MailFrom: arnold@skeeve.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-tuhs.tuhs.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: tuhs@tuhs.org X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [TUHS] Re: FD 2 List-Id: The Unix Heritage Society mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: John Cowan wrote: > On Mon, Jan 30, 2023 at 2:50 AM wrote: > > > What I really like is how in V8 - V10 /dev/tty was a (sym)link to /dev/fd/3, > > and init simply did one more dup call. That eliminated the special tty > > device > > driver and was a lovely generalization / simplification. It's too bad this > > was never picked in the commercial Unixes or in Linux. > > That's problematic. I often need to redirect 2>&1 in order to get a stream > of both output and error into a file or into less(1), without interfering > with *input* from the terminal, as for example a password. I don't see how. Input is from fd 0. fd 3 is open on the original terminal device by init, so even if you closed fd 0, opening /dev/tty gets you fd 3 gets you the original tty. Granted, someone could also redirect fd 3, but that's unlikely in most cases. Arnold