Public bug reported:
Binary package hint: bash
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.04
DISTRIB_CODENAME=lucid
DISTRIB_DESCRIPTION="Ubuntu lucid (development branch)"
apt-cache policy bash
bash:
Installed: 4.1-1ubuntu2
Candidate: 4.1-1ubuntu2
Version table:
*** 4.1-1ubuntu2 0
500 http://es.archive.ubuntu.com lucid/main Packages
100 /var/lib/dpkg/status
What you expected to happen:
This code:
((i++)); echo $?
returns 0 for every value of variable 'i' excepts for i=0. In this case the
operation returns 1 !!!
for example, this script:
#!/bin/bash
set -e
i=1; while :; do ((i++)); echo $i ; sleep 1 ; done
works as expected, but this one:
#!/bin/bash
set -e
i=0; while :; do ((i++)); echo $i ; sleep 1 ; done
exits with error an outputs nothing
** Affects: bash (Ubuntu)
Importance: Undecided
Status: New
--
++ operator exits with error when the variable equals to zero
https://bugs.launchpad.net/bugs/536129
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs