Package: bash
Version: 4.1-3
Severity: normal

Hi,

if a program ist started with $($prog) the output is different from <command>
or even $(<command>). Example with find (excluding a directory from search):

$ ls -l /test
total 16
drwxrwxr-x 2 hgb hgb 4096 Nov  6 02:14 a
drwxrwxr-x 2 hgb hgb 4096 Nov  6 02:14 b
drwxrwxr-x 2 hgb hgb 4096 Nov  6 02:14 c
drwxrwxr-x 2 hgb hgb 4096 Nov  6 02:14 d
$ find /test -type d ! -wholename "/test"
/test/c
/test/b
/test/d
/test/a
$ echo "$(find /test -type d ! -wholename "/test")"
/test/c
/test/b
/test/d
/test/a
$ prog='find /test -type d ! -wholename "/test"'
$ echo $prog
find /test -type d ! -wholename "/test"
$ echo "$($prog)"
/test
/test/c
/test/b
/test/d
/test/a
$

As seen above /test ist shown when $prog is executed.

I see the same behavior with
GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu) (CentOS)
GNU bash, version 3.2.39(1)-release (i486-pc-linux-gnu) (debian)


I understand that the above looks crazy and not like a problem out of real life
.... I had to use find to crawl through a huge tree and remove only a few files
in it. I came across the above problem when feeding an array with the output of
find; I fixed it for now by removing the unwanted entries from the output
array.

Thanks in advance for looking into this.

Regards
        -- hgb



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

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

Versions of packages bash depends on:
ii  base-files                5.9            Debian base system miscellaneous f
ii  dash                      0.5.5.1-7.2    POSIX-compliant shell
ii  debianutils               3.4.1          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-2    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