Date: Wed, 29 Aug 2001 15:10:39 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Andrew Cottrell cc: Charles Sandmann , djgpp-workers AT delorie DOT com Subject: Re: GCC query In-Reply-To: <01af01c13080$12835ab0$0a02a8c0@acceleron> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Wed, 29 Aug 2001, Andrew Cottrell wrote: > What is the expected result of ">&5" is the examples below? You will see that the configure script (every configure script created by Autoconf, in fact) has this near its beginning: exec 5>./config.log This redirects the handle 5 to the file config.log. "1>&5" means the script wants stdout of the command to be redirected to config.log as well. > configure:1689: gcc -o conftest -g -O2 conftest.c 1>&5 > ${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext > $LIBS 1>&5 > d:/dj204/bin/ld.exe: cannot open output file conftest: Permission denied > (EACCES) > collect2: ld returned 1 exit status Was Bash you used here built with all the latest W2K-related patches in _open, _creat, fstat, etc.? How about GCC and Binutils? > DJGPP_204 D:\dj204\gnu\bash-2.05>gcc -o conftest -g -O2 conftest.c 1>&5 > The handle could not be duplicated during redirection of handle 1. This is expected: handle 5 is not connected to anything, so you cannot redirect handle 1 to it. (Also, you shouldn't assume that CMD.EXE supports the full syntax of a Unixy shell, as far as redirection is concerned.) If you want a simple way to reproduce the problem, try doing so in a script which begins with the above-mentioned `exec' command, or from a program which opens some file on handle 5 before it spawns Bash.