[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Inconsistent behavior between ! [ -a /bin/bash ] and [ ! -a /bin/bash ]

From: cromwell
Subject: Inconsistent behavior between ! [ -a /bin/bash ] and [ ! -a /bin/bash ]
Date: Fri, 22 Feb 2002 15:03:42 -0700 (MST)

Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib 
-mcpu=i686    -march=i686 -O3 -funroll-loops
uname output: Linux dp.2y.net 2.4.17 #1 Wed Feb 20 13:20:55 MST 2002 i686 
Machine Type: i686-pc-linux-gnu

Bash Version: 2.05a
Patch Level: 0
Release Status: release

        Inconsistent behavior of [ -a ]
        [  !  -a  /bin/bash  ]  does not give the same results as 
        !  [  -a  /bin/bash  ]

        if  !  [  -a  /bin/bash  ];  echo  "bash not found";  fi
        if  [  !  -a  /bin/bash  ];  echo  "bash not found";  fi
        Both should produce no output, because of course I have bash,
        but the 2nd line prints  "bash not found"

        I can do the same test as above using -x or -e instead of 
        -a and both lines produce no output as expected.        

reply via email to

[Prev in Thread] Current Thread [Next in Thread]