bug-bash
[Top][All Lists]
Advanced

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

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


From: Chet Ramey
Subject: Re: Inconsistent behavior between ! [ -a /bin/bash ] and [ ! -a /bin/bash ]
Date: Mon, 25 Feb 2002 08:37:35 -0500

> 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 
> unknown
> Machine Type: i686-pc-linux-gnu
> 
> Bash Version: 2.05a
> Patch Level: 0
> Release Status: release
> 
> Description:
>       Inconsistent behavior of [ -a ]
>         [  !  -a  /bin/bash  ]  does not give the same results as 
>         !  [  -a  /bin/bash  ]
> 
> Repeat-By:
>       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,

No, they should not.  The rules for three-argument tests are well-
defined.  The manual page and info reference manual, as well as
item E1 of the FAQ, list the rules.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)

Chet Ramey, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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