[Bug 1915] New: Ash -ne test does not fail correctly
bugzilla at busybox.net
bugzilla at busybox.net
Wed Jun 2 21:51:32 UTC 2010
https://bugs.busybox.net/show_bug.cgi?id=1915
Summary: Ash -ne test does not fail correctly
Product: Busybox
Version: unspecified
Platform: Other
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P5
Component: Standard Compliance
AssignedTo: unassigned at busybox.net
ReportedBy: busybox at jakemagee.com
CC: busybox-cvs at busybox.net
Estimated Hours: 0.0
OVERVIEW:
When using the "-ne" test with an empty variable and a number, the test fails
(reports that "" is equal to "0").
On an Ubuntu system running Bash, the following error is produced:
"-bash: [: : integer expression expected"
STEPS TO REPRODUCE:
The following code is an example:
#!/bin/sh
test=""
if [ "$test" -ne "0" ]
then
echo "An error or this should be printed out."
fi
ACTUAL RESULTS:
nothing (the -ne test fails with "" equal to "0")
EXPECTED RESULTS:
an Ash error like "[: : integer expression expected"
PLATFORM:
Using BusyBox 1.11.2 on a PowerPC Linux (OpenWRT 8.01) system.
--
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the busybox-cvs
mailing list