[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bash 3.2.39] File descriptor 10 is always duplicated from 0 and cannot
From: |
Clark J. Wang |
Subject: |
[bash 3.2.39] File descriptor 10 is always duplicated from 0 and cannot be closed |
Date: |
Fri, 31 Oct 2008 14:18:58 +0800 |
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
#
- [bash 3.2.39] File descriptor 10 is always duplicated from 0 and cannot be closed,
Clark J. Wang <=