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
#

Reply via email to