-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Yakov Lerner on 8/23/2007 11:24 AM: > > Description: > x=; test "$x" != "" -a "$x" -le 60 > prints error: > bash: test: : integer expression expected > Shall not this *silently* short-circuit to false after > subexpressio n '"$x" != ""' evaluated > to false ?
According to POSIX, http://www.opengroup.org/onlinepubs/009695399/utilities/test.html, there is no requirement for -a to be short-circuiting, and the results of testing more than 4 arguments (you had 7) is unspecified. So there is no compelling reason to change the current behavior. If you want short-circuiting, do this instead: x=; test "$x" != "" && test "$x" -le 60 - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGzftf84KuGfSFAYARArlOAJ9knaEbvPmpdfB9oR0JIav/IF/cUwCfUN9Y mRmMA4z/S9/MQ+vdxgPDYmo= =wKmK -----END PGP SIGNATURE-----