From owner-freebsd-questions Thu Jan 30 8: 4:36 2003 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2F90137B401 for ; Thu, 30 Jan 2003 08:04:35 -0800 (PST) Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1CA4E43F85 for ; Thu, 30 Jan 2003 08:04:33 -0800 (PST) (envelope-from keramida@ceid.upatras.gr) Received: from gothmog.gr (patr530-b042.otenet.gr [195.167.121.170]) by mailsrv.otenet.gr (8.12.6/8.12.6) with ESMTP id h0UG4CVq000583; Thu, 30 Jan 2003 18:04:12 +0200 (EET) Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.12.6/8.12.6) with ESMTP id h0UG4A6R069000; Thu, 30 Jan 2003 18:04:10 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from giorgos@localhost) by gothmog.gr (8.12.6/8.12.6/Submit) id h0UG4A67068999; Thu, 30 Jan 2003 18:04:10 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Date: Thu, 30 Jan 2003 18:04:10 +0200 From: Giorgos Keramidas To: Ruben de Groot Cc: Jan Grant , Darren Pilgrim , questions@FreeBSD.ORG Subject: Re: Why no /dev/one? Message-ID: <20030130160410.GC51238@gothmog.gr> References: <3E390FF3.5020706@pantherdragon.org> <20030130151339.GA17486@ei.bzerk.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030130151339.GA17486@ei.bzerk.org> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 2003-01-30 16:13, Ruben de Groot wrote: >On Thu, Jan 30, 2003 at 11:53:05AM +0000, Jan Grant typed: >>On Thu, 30 Jan 2003, Darren Pilgrim wrote: >>>Giorgos Keramidas wrote: >>>> On 2003-01-30 00:25, Darren Pilgrim wrote: >>>>> Why isn't there a /dev/one device to provide an infinite number of >>>>> all-ones bytes? >>>> >>>> Because it's easy to get any sequence of equal bytes by using just >>>> /dev/zero and tr(1). Try this command and check the output of hd(1) >>>> :-) >>>> >>>> $ dd if=/dev/zero bs=512 count=1 | tr '\0' '\777' | hd >>> >>>What I was trying to get at was more a question of if there's some deep >>>technical reason for the lack of a /dev/one beyond the triviality of >>>flipping the bits in a pipe. >> >> Nobody's implemented it. It'd be trivial; but why would you want it? That's a good reason. Nobody has written one, because nobody thought there would be a good reason to have one. Of course, patches that implement something like that are always ok. But then we'd have to write kernel drivers for /dev/two, /dev/three and /dev/one-million-six too and that's not a good idea :-( > And while you're at it, what about /dev/yes and /dev/no to automate > interactive scripts. Or, if you like the challenge, a /dev/fibonacci > and a /dev/pi would be very welcome :) Argh no! :P This is even more easy with yes(1) $ yes 'custom text' | head -3 custom text custom text custom text $ /me hides in a corner to save himself from the evil tomatoes that are probably heading his way by now :) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message