From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 12 09:58:37 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 D5C92106564A for ; Fri, 12 Dec 2008 09:58:37 +0000 (UTC) (envelope-from rihad@mail.ru) Received: from mx27.mail.ru (mx27.mail.ru [194.67.23.23]) by mx1.freebsd.org (Postfix) with ESMTP id 94F2B8FC08 for ; Fri, 12 Dec 2008 09:58:37 +0000 (UTC) (envelope-from rihad@mail.ru) Received: from [217.25.27.27] (port=25123 helo=[217.25.27.27]) by mx27.mail.ru with asmtp id 1LB4n5-000IkE-00 for freebsd-hackers@freebsd.org; Fri, 12 Dec 2008 12:58:35 +0300 Message-ID: <494235CA.2050101@mail.ru> Date: Fri, 12 Dec 2008 13:58:34 +0400 From: rihad User-Agent: Icedove 1.5.0.14eol (X11/20080724) MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: Not detected X-Mras: OK X-Mailman-Approved-At: Fri, 12 Dec 2008 12:47:59 +0000 Subject: preventing FIFO from EOF X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: rihad@mail.ru 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 09:58:37 -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.