From owner-freebsd-standards@FreeBSD.ORG Sat Jul 8 09:09:32 2006 Return-Path: X-Original-To: freebsd-standards@freebsd.org Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4A70616A4DE for ; Sat, 8 Jul 2006 09:09:32 +0000 (UTC) (envelope-from jan.grant@bristol.ac.uk) Received: from diri.bris.ac.uk (diri.bris.ac.uk [137.222.10.112]) by mx1.FreeBSD.org (Postfix) with ESMTP id D3BB443D4C for ; Sat, 8 Jul 2006 09:09:31 +0000 (GMT) (envelope-from jan.grant@bristol.ac.uk) Received: from mail.ilrt.bris.ac.uk ([137.222.16.62]) by diri.bris.ac.uk with esmtp (Exim 4.60) (envelope-from ) id 1Fz8ob-0000ji-1l; Sat, 08 Jul 2006 10:09:30 +0100 Received: from cse-jg.cse.bris.ac.uk ([137.222.12.37]:64462) by mail.ilrt.bris.ac.uk with esmtps (TLSv1:AES256-SHA:256) (Exim 4.50) id 1Fz8oU-0000rk-KK; Sat, 08 Jul 2006 10:09:26 +0100 Date: Sat, 8 Jul 2006 10:09:20 +0100 (BST) From: Jan Grant X-X-Sender: cmjg@tribble.ilrt.bris.ac.uk To: Bruce Evans In-Reply-To: <20060708120806.U6238@delplex.bde.org> Message-ID: <20060708100421.N41181@tribble.ilrt.bris.ac.uk> References: <20060707201402.T14116@tribble.ilrt.bris.ac.uk> <20060707222343.GA10756@gothmog.pc> <20060708120806.U6238@delplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spamassassin: mail.ilrt.bris.ac.uk X-Spam-Score: 0.0 X-Spam-Level: / X-Spam-Score: -1.4 X-Spam-Level: - Cc: freebsd-standards@freebsd.org Subject: Re: stdio/sh behaviour guaranteed? X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jul 2006 09:09:32 -0000 On Sat, 8 Jul 2006, Bruce Evans wrote: > Using stdio for input from pipelines in shells is almost absolutely not > possible, since stdio normally does buffering and any buffering breaks > pipelines since there is no way to unread characters from a pipe. E.g.: > > printf "%s\n%s\n" foo bar | > sh -c 'read x; echo $$: $x; sh -c "read y; echo \$$: \$y"' I think yours is a much better example. (I couched my question in terms of stdio behvaiour because it occurred to me that shell behaviour might be expressed (specified) in terms of it, but I'm after the shell behaviour in particular). > > > And in particular, is the idiom above blessed by appropriate > > > posix standards? > > Stuff like this has to work to satisfy at least defacto standards. That was the conclusion I was coming to. Cheers, jan -- jan grant, ISYS, University of Bristol. http://www.bris.ac.uk/ Tel +44 (0)117 3317661 http://ioctl.org/jan/ It's a sad fact that the word "semantics" seems to have lost all meaning.