From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id 8468C21168 for ; Thu, 21 Mar 2024 11:07:24 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1711015644; b=sG6kbeDOvyE/xhd4vOl36TcxhKR6rZobmfkAo2s9vAn4rOC8edenxDb3AGzA4JmU2xwpn/6B6E I/+QnDG91YqlbHGYBBq1ru6cRYTPH0qmvmSAEnGwZ5kwJgGoZjWwErUVQl+mV1x+QRgw9DLi93 vTHCaeauytA5QWSJRFp6KGbKeqU/qN2KiDNncbdeQn2MPBnWuznST5HrN2ii4KSYCboafPDChp Lgdh01zB/yWg+xVknoKLZTLX6WfSsPsHVvZERQSjfG+7N6gfXj6Ais9z8lZNCFsOj0zSJJ0Tnu vu43YoXNiova+LR5aAbBm2mSXNcNGcrRudVa+icRum2z3w==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1711015644; bh=8aRhTu0znwMiv2cPdrxGJZAwpUusFenRska2rE+S1qU=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:MIME-Version: Message-ID:Subject:To:From:Date:DKIM-Signature; b=C1r8BJg2bX4FSOy4vo1M3M1d2fTWaDdGD1/9rjAQo+EexnA2nu9YI0BeE+98TeBnasecrtzSpX 781OvjCT7T+CS+Z2CrLG1A2hS7iQs6S9pJ3Ko5zC6YUKCCWabxpNhOOWjp0FV/hqgKVa8eDN5a Wl1h2lPP2z2xF3rkx2mWqq13nOTjGLmU0SXeGnrNesxNIam8/qcpMhLvpQLgnhyDKuWetaUrZh AK3VKzIFddqsNzge2Kc0xIN3A0FCmraXJecAmEOwa7DdcPWZ0Fl4fI8K7tRYIZ/487DqWRdykx iimBp6yfv0YoDGGkVQ8xfPK3FxhS91cj2hduxvsJTyClMQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Message-ID:Subject:To:From:Date:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References; bh=5AEn7byaFQqksW+FkFLu8i8YvKWB/hshesz63ZeRog0=; b=ikn2lDfCnabKwjCCB9hmZZZOIO Pal1knNCHWjvbTnknkJLUS8zxv823IJtWO2x2vY1RywZ/J2pK4A/r1jotAGNsGW44nMCNKjHQC4sU LslU0wvUqn7kY0vEoDeEgyT5ilOLMVxQaChmfyA3CpJh/jjGIAYJREiJIN0REkXNgKbWLdyrYfHiO oL/J9h7e7ggGimypb8Isv31wOYa0SEJlhnv5ptRaC3s3ehlzjZvBTv5g75Jgwu5Ni66lyJTQB6l7N ObNMj+PiMZKDkK8HDJPS1mgHt+qt8/D0Po54BVitY27vfxwFjeNiw63MExyMLJCQ2xg/MzUSG2hR9 TApRr5Yg==; Received: by zero.zsh.org with local id 1rnFKW-00019w-Cu; Thu, 21 Mar 2024 10:07:24 +0000 Authentication-Results: zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none Received: from joooj.vinc17.net ([155.133.131.76]:50226) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1rnFKL-0000oz-7g; Thu, 21 Mar 2024 10:07:13 +0000 Received: from smtp-qaa.vinc17.net (2a02-8428-1b1d-4d01-96a9-491d-7b48-ba31.rev.sfr.net [IPv6:2a02:8428:1b1d:4d01:96a9:491d:7b48:ba31]) by joooj.vinc17.net (Postfix) with ESMTPSA id 9DF20888; Thu, 21 Mar 2024 11:07:12 +0100 (CET) Received: by qaa.vinc17.org (Postfix, from userid 1000) id 36991CA00B0; Thu, 21 Mar 2024 11:07:10 +0100 (CET) Date: Thu, 21 Mar 2024 11:07:10 +0100 From: Vincent Lefevre To: zsh-workers@zsh.org Subject: behavior of test true -a \( ! -a \) Message-ID: <20240321100710.GA164665@qaa.vinc17.org> Mail-Followup-To: zsh-workers@zsh.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/2.2.12+69 (354c5b11) vl-149028 (2023-12-10) X-Seq: 52788 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: I know that the "test" utility (builtin in zsh) is ambiguous, is not completely specified by POSIX and should not be used, but IMHO, it should behave in a sensible and consistent way. The following with zsh 5.9 is inconsistent: qaa% test \( ! -a \) ; echo $? 1 qaa% test true -a \( ! -a \) ; echo $? test: argument expected 2 In the second case, one should just get 1, like in the first case. In 2008, I had noted at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=421591#25 that zsh was returning 1 as expected. So it seems that this has changed. This bug is about bash giving an error (like zsh now), but note that with ash (BusyBox v1.36.1 sh), dash 0.5.12 and the "test" command from the GNU coreutils 9.4, one gets 1 in these two cases. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)