#607079 bash: Problem with redirection from file descriptor >10

Package:
bash
Source:
bash
Description:
GNU Bourne Again SHell
Submitter:
Roland Stigge
Date:
2010-12-14 15:03:04 UTC
Severity:
normal
#607079#5
Date:
2010-12-14 14:59:05 UTC
From:
To:
Hi,

consider the following script:

======================================================================
#!/bin/bash

job1() {
	echo abc
	sleep 1
	echo def
}

coproc job1

echo ${COPROC[0]}
echo ${COPROC[1]}

( while read i ; do echo $i ; done ) <&${COPROC[0]}

wait
======================================================================

(Most important here is the "${COPROC[0]}" which for me expands to 63 or
similar, a number >10)

Running it:

$ ./test.sh
63
60
./test.sh: line 14: ${COPROC[0]}: Bad file descriptor
$

So COPROC[0] is "63".

Using "<&{COPROC[0]}" (just to make sure I tried everything) instead leads to:

$ ./test.sh
63
60
./test.sh: line 14: {COPROC[0]}: ambiguous redirect
$

Maybe this is related to #423400. Not sure.

Thanks for considering.

bye,
  Roland