-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Charlie Bennett on 4/14/2006 9:17 AM: > Is this expected behavior? > > [EMAIL PROTECTED] .ssh]# [ -f ] > [EMAIL PROTECTED] .ssh]# echo $? > 0
Yes. POSIX requires 'test' (aka '['), when handed exactly one argument, to return 0 if it is non-empty and 1 if it is empty. Since "-f" is two characters, it is non-empty and returns true. It is only a file test if there are two arguments handed to 'test'. > Here's a hack fix: And the hack is wrong, because it would violate POSIX semantics. - -- Life is short - so eat dessert first! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.1 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEQUDF84KuGfSFAYARAt6eAJ4+IBL0GsARdpZuK3D3NhEZCRnY0ACeLeLj wSIAHs92UqGHXL5dQnE9+q0= =SVWs -----END PGP SIGNATURE----- _______________________________________________ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash