I'm running bash 3.0. I'm seeing the same thing in
the Fedora 4 distributed version and in a copy built
from the stable tarball.
Is this expected behavior?
[EMAIL PROTECTED] .ssh]# [ -f ]
[EMAIL PROTECTED] .ssh]# echo $?
0
All of the file test ops behave the same way.
in test.c, we call posixtest()
posixtest() sees one arg and calls ONE_ARG_TEST which
is a 'presence' test, effectively the opposite of -z.
This can never work.
Here's a hack fix:
[EMAIL PROTECTED] bash-3.0]# diff test.c test.c.orig
799,820c799
<
< #define ONE_ARG_TEST(s) ( one_arg_allowed( (s) ) && (s)[0] != '\0' )
<
< static int one_arg_allowed( char *s ) {
<
< char *unaries = "bcdefghGkLOnprsStuwx";
<
< if( s[0] != '-' ) {
< /* not a potential switch */
< return(TRUE);
< }
< if( s[1] == '\0' ) {
< /* solo '-', this is a "string presence" test */
< return(TRUE);
< }
< if( NULL == index( unaries, s[1] ) ) {
< return(TRUE);
< }
< test_syntax_error( _("%s: argument expected"), s);
< return(FALSE);
< }
<
---
> #define ONE_ARG_TEST(s) ((s)[0] != '\0')
_______________________________________________
Bug-bash mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-bash