From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 12 13:50:59 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 F2BF3106564A for ; Fri, 12 Dec 2008 13:50:59 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id 44C2F8FC17 for ; Fri, 12 Dec 2008 13:50:59 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: (qmail invoked by alias); 12 Dec 2008 13:50:57 -0000 Received: from p54A3E756.dip.t-dialin.net (EHLO tron.homeunix.org) [84.163.231.86] by mail.gmx.net (mp028) with SMTP; 12 Dec 2008 14:50:57 +0100 X-Authenticated: #1673122 X-Provags-ID: V01U2FsdGVkX183bqEY1G03lmnHtV2ing/PGolRoPmSaEriyM0S8X 1TJoeWeLMmrFAA Message-ID: <49426C40.6050802@gmx.de> Date: Fri, 12 Dec 2008 14:50:56 +0100 From: Christoph Mallon User-Agent: Thunderbird 2.0.0.18 (X11/20081124) MIME-Version: 1.0 To: rihad@mail.ru References: <494235CA.2050101@mail.ru> In-Reply-To: <494235CA.2050101@mail.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.74 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:51:00 -0000 rihad schrieb: > $ 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. Maybe "tail -f" is what you are looking for.