[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
File Descriptors problem
From: |
Chris Robinson |
Subject: |
File Descriptors problem |
Date: |
Tue, 1 Apr 2003 15:14:49 +0200 |
From: chris@iceberg.co.za
To: bug-bash@gnu.org
Subject: Redirection: File Descriptor can't be closed/reopened.
Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation
CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-gnu' -D
CONF_MACHTYPE='i686-pc-linux-gnu' -DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H
-I. -I. -I./include -I./lib -D_GNU_SOURCE -O2 -march=i386 -mcpu=i686
uname output: Linux develop.netpartner.co.za 2.4.18-14 #1 Wed Sep 4 12:13:11
EDT 2002 i686 athlon i386 GNU/Linux
Machine Type: i686-pc-linux-gnu
Bash Version: 2.05b
Patch Level: 0
Release Status: release
Description:
Given a file 'f' with the line 'aaa', the following code should display the
line
endlessly, but it only displays it once because the FD close/open statements
fail to
reopen the file at the beginning. I have tried using multiple FDs and
duplicating,
etc, but nothing will force a clean reopen of FD 3 on 'f':
Repeat-By:
3<f
while [ 1 ]; do
read x <&3
echo $x
if [ "$x" = "" ]; then
sleep 1
3<&-
3<f
fi
done
- File Descriptors problem,
Chris Robinson <=