[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bash 3.2.39] File descriptor 10 is always duplicated from 0 and can
From: |
Jian Wang |
Subject: |
Re: [bash 3.2.39] File descriptor 10 is always duplicated from 0 and cannot be closed |
Date: |
Fri, 31 Oct 2008 16:03:23 +0800 |
On Fri, Oct 31, 2008 at 14:59, Chris F.A. Johnson <cfajohnson@gmail.com>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 different behavior of fd 10 and 11. Fd
10 is closed but afterward read from it reported no error. That's the
problem.
>
> $ (
> exec 11<$HOME/.bashrc
>
> while read <&11
> do
> printf .
> done
> echo
>
> exec 11<&-
> )
> ................................................................
>
>
> --
> Chris F.A. Johnson, webmaster <http://Woodbine-Gerrard.com>
> ===================================================================
> Author:
> Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
>