On Fri, Oct 31, 2008 at 14:18, Clark J. Wang <[EMAIL PROTECTED]> wrote:

> Hi, all:
>
> When I was doing some testing I found the file descriptor 10 is always
> duplicate of fd 0 and it cannot be closed.
>
> See the following commands:
>
> # echo $BASH_VERSION
> 3.2.39(1)-release
> # read line <&10
> hello    <--- input from keyboard
> # echo $line
> hello
> # exec 10<&-    <--- try to close fd 10
> # read line <&10    <--- no error reported, so fd 10 is still open?
> hello    <--- input from keyboard
> # echo $line
> hello
> # read line <&11    <--- test with fd 11
> bash: 11: Bad file descriptor
> #
>
And, even though we can read from fd 10 but there's no such an fd under
/proc/$$/fd directory.

Reply via email to