From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10b612,816e95a3ecab514e X-Google-Attributes: gid10b612,public X-Google-Thread: fee84,816e95a3ecab514e X-Google-Attributes: gidfee84,public X-Google-Thread: 1094ba,816e95a3ecab514e X-Google-Attributes: gid1094ba,public X-Google-Thread: 1164f8,816e95a3ecab514e X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1994-02-26 06:43:40 PST Xref: gmd.de comp.sys.dec:13615 comp.lang.fortran:10392 comp.unix.osf.osf1:2349 comp.unix.ultrix:13136 Path: gmd.de!xlink.net!howland.reston.ans.net!pipex!lyra.csx.cam.ac.uk!pavo.csi.cam.ac.uk!michael From: michael@mail.ast.cam.ac.uk (Michael Lemke) Newsgroups: comp.sys.dec,comp.lang.fortran,comp.unix.osf.osf1,comp.unix.ultrix Subject: Re: Interesting Fortran Behaviour Date: 25 Feb 1994 10:49:37 GMT Organization: Institute of Astronomy, Cambridge, UK Message-ID: <2kkl41$4cn@lyra.csx.cam.ac.uk> References: NNTP-Posting-Host: cast0.ast.cam.ac.uk In article , Wesp Gerhard wrote: > Consider the following little C and Fortran programs: >--- 4711.c ------------------------- >#include > >void main() >{ > int i; > for(i= 1; i <= 4000; i++) > printf("4711.47114711\n"); >} >------------------------------------ >This just prints the number 4711.47114711 to stdout 4000 times and then >terminates. > >--- crunch.f ----------------------- > program crunch > > integer i > double precision a > > do 4711 i= 1, 4000 > read *, a >4711 continue > > print *, 'read 4000 numbers' > > end >------------------------------------ >This trys to read 4000 numbers from stdin, and, if successfully, prints >the message 'read 4000 numbers' to stdout and terminates. > > So what would you expect if you connect those two programs by a pipe, e.g. >"4711 | crunch"? Well, 4711 should produce 4000 numbers, crunch should con- >sume them and happily terminate with 'read 4000 numbers'. > And that's exactly what it does on a good old Tektronix m88k workstation. > And that's exactly what it does on a Sun workstation. Michael -- Michael Lemke Institute of Astronomy, Cambridge UK (michael@io.as.utexas.edu or UTSPAN::UTADNX::IO::MICHAEL [SPAN])