Re: [bash 3.2.39] File descriptor 10 is always duplicated from 0 and cannot be closed

2008-11-02 Thread Clark J. Wang
On Mon, Nov 3, 2008 at 06:19, Chet Ramey <[EMAIL PROTECTED]> wrote: > Clark J. Wang wrote: > > > When I was doing some testing I found the file descriptor 10 is always > > duplicate of fd 0 and it cannot be closed. > > Half right. When a redirection involving fd 0 is evaluated, the shell > has to

Re: [bash 3.2.39] File descriptor 10 is always duplicated from 0 and cannot be closed

2008-11-02 Thread Chet Ramey
Clark J. Wang wrote: > When I was doing some testing I found the file descriptor 10 is always > duplicate of fd 0 and it cannot be closed. Half right. When a redirection involving fd 0 is evaluated, the shell has to save fd 0 somewhere so it can be restored. It uses fcntl to duplicate fd 0 to s

Re: [bash 3.2.39] File descriptor 10 is always duplicated from 0 and cannot be closed

2008-10-31 Thread Jian Wang
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

Re: [bash 3.2.39] File descriptor 10 is always duplicated from 0 and cannot be closed

2008-10-31 Thread Jian Wang
On Fri, Oct 31, 2008 at 14:59, Chris F.A. Johnson <[EMAIL PROTECTED]>wrote: > On 2008-10-31, Clark J. Wang wrote: > ... > > # read line <&11<--- test with fd 11 > > bash: 11: Bad file descriptor > > # > > You haven't opened file descriptor 11: > You're right. I just want to show the differ

Re: [bash 3.2.39] File descriptor 10 is always duplicated from 0 and cannot be closed

2008-10-31 Thread Chris F.A. Johnson
On 2008-10-31, Clark J. Wang wrote: ... > # read line <&11<--- test with fd 11 > bash: 11: Bad file descriptor > # You haven't opened file descriptor 11: $ ( exec 11<$HOME/.bashrc while read <&11 do printf . done echo exec 11<&- ) ..

[bash 3.2.39] File descriptor 10 is always duplicated from 0 and cannot be closed

2008-10-30 Thread Clark J. Wang
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