delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/08/29/08:15:04

Date: Wed, 29 Aug 2001 15:10:39 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Andrew Cottrell <acottrel AT ihug DOT com DOT au>
cc: Charles Sandmann <sandmann AT clio DOT rice DOT edu>, djgpp-workers AT delorie DOT com
Subject: Re: GCC query
In-Reply-To: <01af01c13080$12835ab0$0a02a8c0@acceleron>
Message-ID: <Pine.SUN.3.91.1010829145544.16952I-100000@is>
MIME-Version: 1.0
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

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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019