[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
short-circuit test ... -a ...
From: |
Yakov Lerner |
Subject: |
short-circuit test ... -a ... |
Date: |
Thu, 23 Aug 2007 20:24:48 +0300 |
Configuration Information [Automatically generated, do not change]:
Machine: i486
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash'
-DSHELL -DHAVE_CONFIG_H -I. -I../bash -I../bash/include
-I../bash/lib -g -O2 -Wall
uname output: Linux h-kub7 2.6.20-15-generic #2 SMP Sun Apr 15
07:36:31 UTC 2007 i686 GNU/Linux
Machine Type: i486-pc-linux-gnu
Bash Version: 3.2
Patch Level: 13
Release Status: release
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 ?
Repeat-By:
always
Fix:
Short-circuit 'test ... -a ... 'when lhs evaluates to false.
- short-circuit test ... -a ...,
Yakov Lerner <=