redirect stdin in k/sh ?

Chet Ramey chet at odin.INS.CWRU.Edu
Tue Feb 12 09:02:03 AEST 1991


>What's the difference between the following two ways in handling
>stdin in k/sh ?
>
>	foo </dev/null

This means that foo sees stdin (file descriptor 0) as a valid file
descriptor, but one that returns EOF (read returns 0) on first read. 

>vs.
>	foo <&-

foo sees its file descriptor 0 as closed, which means that reads on fd
0 return -1 with errno set to EBADF.

Chet
-- 
Chet Ramey				``There's just no surf in
Network Services Group			  Cleveland, U.S.A. ...''
Case Western Reserve University
chet at ins.CWRU.Edu		My opinions are just those, and mine alone.



More information about the Comp.unix.questions mailing list