Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [bug?] test adf -ge 0



In the last episode (Aug 31), James William Pye said:
> Using 4.2.0, why does this return successful?

Probably because atoi("sdf") returns 0, so the test succeeds.
 
> Both sh(freebsd) and bash echo an error message and return 2.

/bin/sh on Tru64 5.1, AIX 5.2, and Solaris 9 all succeed.

> I know zsh is not bash or sh, but this is a fairly serious
> inconsistency, IMO.

It's probably in the range of "undefined behaviour".  I can't find any
manpages or standards docs that say that test must verify that numeric
arguments are really numbers.

-- 
	Dan Nelson
	dnelson@xxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author