Package: bash
Version: 4.2-4
Severity: normal

Hi.

Default value parameter expansion works differently in dash and bash, and i
believe, that dash's behavior is correct one.

$ bash -c 'set -- ""; echo "A${*:-w}R";'
AR
$ dash -c 'set -- ""; echo "A${*:-w}R";'
AwR

Because the colon is present, if parameter ("$*" in the example) is null, it
should be replaced with word (character 'w' in the example). And parameter is
null indeed:

$ bash -c 'set -- ""; echo "A${*}R";'
AR
$ dash -c 'set -- ""; echo "A${*}R";'
AR

but bash still does not replace it with word.

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (990, 'testing'), (200, 'unstable'), (100, 'stable-updates'), 
(100, 'stable')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-3-686-pae (SMP w/2 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=ru_RU.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages bash depends on:
ii  base-files   6.11
ii  dash         0.5.7-3
ii  debianutils  4.3.2
ii  libc6        2.13-35
ii  libtinfo5    5.9-10

Versions of packages bash recommends:
ii  bash-completion  1:2.0-1

Versions of packages bash suggests:
ii  bash-doc  4.2-4

-- 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