Package: bash
Version: 4.1-3
Severity: normal

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

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (x86_64)

Kernel: Linux 2.6.35-trunk-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages bash depends on:
ii  base-files                5.10           Debian base system miscellaneous f
ii  dash                      0.5.5.1-7.3    POSIX-compliant shell
ii  debianutils               3.4.2          Miscellaneous utilities specific t
ii  libc6                     2.11.2-7       Embedded GNU C Library: Shared lib
ii  libncurses5               5.7+20100313-4 shared libraries for terminal hand

Versions of packages bash recommends:
ii  bash-completion               1:1.2-3    programmable completion for the ba

Versions of packages bash suggests:
pn  bash-doc                      <none>     (no description available)

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to