[comp.unix.questions] redirect stdin in k/sh ?

chet@odin.INS.CWRU.Edu (Chet Ramey) (02/12/91)

>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@ins.CWRU.Edu		My opinions are just those, and mine alone.