Mail Archives: djgpp-workers/2001/08/29/08:15:04
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 -