[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-standards
Subject:    Re: stdio/sh behaviour guaranteed?
From:       Jan Grant <jan.grant () bristol ! ac ! uk>
Date:       2006-07-08 9:09:20
Message-ID: 20060708100421.N41181 () tribble ! ilrt ! bris ! ac ! uk
[Download RAW message or body]

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.
_______________________________________________
freebsd-standards@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-standards
To unsubscribe, send any mail to "freebsd-standards-unsubscribe@freebsd.org"
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic