From owner-freebsd-hackers Fri Jul 5 10:24:10 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id KAA11080 for hackers-outgoing; Fri, 5 Jul 1996 10:24:10 -0700 (PDT) Received: from mail.cs.tu-berlin.de (root@mail.cs.tu-berlin.de [130.149.17.13]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id KAA11020 for ; Fri, 5 Jul 1996 10:24:01 -0700 (PDT) Received: from campa.panke.de (anonymous234.ppp.cs.tu-berlin.de [130.149.17.234]) by mail.cs.tu-berlin.de (8.6.12/8.6.12) with ESMTP id TAA01668; Fri, 5 Jul 1996 19:18:50 +0200 Received: (from wosch@localhost) by campa.panke.de (8.6.12/8.6.12) id TAA00676; Fri, 5 Jul 1996 19:10:04 +0200 Date: Fri, 5 Jul 1996 19:10:04 +0200 From: Wolfram Schneider Message-Id: <199607051710.TAA00676@campa.panke.de> To: Toshihiro Kanda Cc: freebsd-hackers@FreeBSD.org Subject: test(1) -h behavior (bug??) In-Reply-To: <199607050547.OAA15001@xxx.fct.kgc.co.jp> References: <199607050547.OAA15001@xxx.fct.kgc.co.jp> Reply-to: Wolfram Schneider MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk Already fixed. test.c revision 1.12 date: 1995/10/28 11:54:42; author: ache; state: Exp; lines: +2 -2 Fix -h option: sense symlink even it is unresolved Toshihiro Kanda writes: > If a symbolic link file ``foo'' points non-existence file, should >``/bin/test foo'' return 0 or 1? > > In FreeBSD 2.1R, /bin/test returns 1. While built-in command `test' >of `GNU bash, version 1.14.2(1)' returns 0. > > bash$ ln -s nofile foo > bash$ /bin/test -h foo ; echo $? > 1 > bash$ test -h foo ; echo $? > 0 > > I've tested `SunOS 4.1.3_U1 sun4c', `NetBSD 1.1 sparc' and `IRIX64 >6.2 IP19'. Then all these /bin/test returned 0. > >candy@fct.kgc.co.jp (Toshihiro Kanda)