From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 12 13:24:10 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 062A41065670 for ; Fri, 12 Dec 2008 13:24:10 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from kabab.cs.huji.ac.il (kabab.cs.huji.ac.il [132.65.16.84]) by mx1.freebsd.org (Postfix) with ESMTP id B3C468FC12 for ; Fri, 12 Dec 2008 13:24:09 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from pampa.cs.huji.ac.il ([132.65.80.32]) by kabab.cs.huji.ac.il with esmtp id 1LB7zz-0006kU-SU; Fri, 12 Dec 2008 15:24:07 +0200 X-Mailer: exmh version 2.7.2 01/07/2005 with nmh-1.2 To: rihad@mail.ru In-reply-to: <494235CA.2050101@mail.ru> References: <494235CA.2050101@mail.ru> Comments: In-reply-to rihad message dated "Fri, 12 Dec 2008 13:58:34 +0400." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 12 Dec 2008 15:24:07 +0200 From: Danny Braniss Message-ID: Cc: freebsd-hackers@freebsd.org Subject: Re: preventing FIFO from EOF X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Dec 2008 13:24:10 -0000 > $ mkfifo /var/tmp/foo > $ buffer -i /var/tmp/foo # misc/buffer > # in another console: > $ echo hi > /var/tmp/foo > > buffer prints hi and exits. I want it to keep reading and printing > indefinitely. > > Further experimentation revealed that I need two writers: one dummy > writer that just keeps /var/tmp/foo open for writing, and the other > doing the "real work". This way buffer wouldn't exit. But how to emulate > the dummy writer? It itself needs to block on something to keep > /var/tmp/foo open. Any clean way to do this in shell? Maybe the solution > is quite simple but isn't at the tip of my tongue. > > Thanks. too easy n csh: while 1 buffer -i /var/tmp/foo end or in sh: while true; do buffer -i /var/tmp/foo done