From owner-freebsd-bugs@FreeBSD.ORG Sun Mar 2 22:07:57 2014 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2AA75AEB; Sun, 2 Mar 2014 22:07:57 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 17CF21DBA; Sun, 2 Mar 2014 22:07:57 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s22M7uNP043942; Sun, 2 Mar 2014 22:07:56 GMT (envelope-from jilles@freefall.freebsd.org) Received: (from jilles@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s22M7uMZ043941; Sun, 2 Mar 2014 22:07:56 GMT (envelope-from jilles) Date: Sun, 2 Mar 2014 22:07:56 GMT Message-Id: <201403022207.s22M7uMZ043941@freefall.freebsd.org> To: pirzyk@freebsd.org, jilles@FreeBSD.org, freebsd-bugs@FreeBSD.org, jilles@FreeBSD.org From: jilles@FreeBSD.org Subject: Re: bin/155786: [patch] test(1): '/bin/test -d' fails to report syntax error X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2014 22:07:57 -0000 Synopsis: [patch] test(1): '/bin/test -d' fails to report syntax error State-Changed-From-To: open->closed State-Changed-By: jilles State-Changed-When: Sun Mar 2 22:06:16 UTC 2014 State-Changed-Why: This is not a bug. '/bin/test -d' is not an error and is supposed to return true (0). This is because '-d' in 'test -d' is a string operand that is tested for non-emptiness. In the man page test(1): string True if string is not the null string. In the POSIX specification (SUSv4+TC1), also look for the algorithm for resolving the ambiguities in test: > 1 argument: Exit true (0) if $1 is not null; otherwise, exit false. Responsible-Changed-From-To: freebsd-bugs->jilles Responsible-Changed-By: jilles Responsible-Changed-When: Sun Mar 2 22:06:16 UTC 2014 Responsible-Changed-Why: Track replies. http://www.freebsd.org/cgi/query-pr.cgi?pr=155786