Package: posh
Version: 0.12.3
Severity: normal

Dear Maintainer,

$ env -u a posh -c 'echo $((a))'
posh: : unexpected `end of expression'
$ env a= posh -c 'echo $((a))'
0

I can't see why posh would return an error in the first case and
not the second.

$ env a=1+1 posh -c 'echo $((a))'
2
$ env a=b b=3 posh -c 'echo $((a))'
3


Note that in all the above the behavior is unspecified by POSIX
(as per my reading of the spec). Variables have to contain
"valid integer constants optionally including a leading plus or
minus sign" (though I'm not too sure about the empty/unset case
because of the
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap01.html#tag_17_01_02_01
section)

Dash:

$ a=1+1 ash -c 'echo $((a))'
ash: 1: Illegal number: 1+1
$ a=b b=1 ash -c 'echo $((a))'
ash: 1: Illegal number: b
$ a= ash -c 'echo $((a))'
0


-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (500, 'testing'), (50, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.12-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages posh depends on:
ii  debconf [debconf-2.0]  1.5.52
ii  libc6                  2.18-4

posh recommends no packages.

posh suggests no packages.

-- debconf-show failed


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