http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56555
Bug #: 56555 Summary: read from pipe Classification: Unclassified Product: gcc Version: 4.7.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassig...@gcc.gnu.org ReportedBy: fu...@hawaii.edu When reading from stdin in a simple pipe, the Fortran runtime reports an "End of file" error. See the self contained example below. It was done on a Debian-testing system. The shell is a symlink to /bin/dash . Regards, Ryo --------------------------------------- $ cat try.f90 program try real(4):: r integer:: i do !! infinite loop read(*,*) r write(*,*) r end do end program try $ gfortran -o try try.f90 $ cat try.sh #!/bin/sh for n in `seq 1 10`; do echo $n | ./try done $ sh try.sh 1.00000000 At line 5 of file try.f90 (unit = 5, file = 'stdin') Fortran runtime error: End of file 2.00000000 At line 5 of file try.f90 (unit = 5, file = 'stdin') Fortran runtime error: End of file 3.00000000 At line 5 of file try.f90 (unit = 5, file = 'stdin') Fortran runtime error: End of file 4.00000000 At line 5 of file try.f90 (unit = 5, file = 'stdin') Fortran runtime error: End of file 5.00000000 At line 5 of file try.f90 (unit = 5, file = 'stdin') Fortran runtime error: End of file 6.00000000 At line 5 of file try.f90 (unit = 5, file = 'stdin') Fortran runtime error: End of file 7.00000000 At line 5 of file try.f90 (unit = 5, file = 'stdin') Fortran runtime error: End of file 8.00000000 At line 5 of file try.f90 (unit = 5, file = 'stdin') Fortran runtime error: End of file 9.00000000 At line 5 of file try.f90 (unit = 5, file = 'stdin') Fortran runtime error: End of file 10.0000000 At line 5 of file try.f90 (unit = 5, file = 'stdin') Fortran runtime error: End of file $