From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 17 17:25:36 2015 Received: (at submit) by debbugs.gnu.org; 17 Mar 2015 21:25:36 +0000 Received: from localhost ([127.0.0.1]:50412 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YXyzY-0002Fk-5w for submit@debbugs.gnu.org; Tue, 17 Mar 2015 17:25:36 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58220) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YXyx8-0002Bo-KU for submit@debbugs.gnu.org; Tue, 17 Mar 2015 17:23:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YXyx7-0002sn-Fs for submit@debbugs.gnu.org; Tue, 17 Mar 2015 17:23:06 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_40,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:58777) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXyx7-0002si-DL for submit@debbugs.gnu.org; Tue, 17 Mar 2015 17:23:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59923) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXyx6-0006uC-GG for bug-coreutils@gnu.org; Tue, 17 Mar 2015 17:23:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YXyx5-0002s6-J8 for bug-coreutils@gnu.org; Tue, 17 Mar 2015 17:23:04 -0400 Received: from mail-wg0-x236.google.com ([2a00:1450:400c:c00::236]:36512) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXyx5-0002rz-Ch for bug-coreutils@gnu.org; Tue, 17 Mar 2015 17:23:03 -0400 Received: by wgra20 with SMTP id a20so19036793wgr.3 for ; Tue, 17 Mar 2015 14:23:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=/N+dUgfT1ovS2uxFZdiaxZ5etHUVa2/mFQqypxJtG70=; b=snh+F4weNTL2lUsaGzzM0isU6r98m/WAvqARAbEQ8iNI/VJeiwMjTNPNnKIg7wLVZg TIuG2VhoZV95sjuYxAIBSstSm7RbJu+jHG1eQwdzxpq7TPp4m+ZgKuRQ93L9rzCMYG/u ydRMzRQR41mwOHcimg+MM9W3gZHCUfq2vasNrqIuAxUatGSKcoSxoY14Ao+oYJkdkq43 R18ECWGxQW0CRuWRJ/diO149UshNCG8c19K+0rXzskqZXaszVHhRhUmkojAXys7RRCn2 JhZmMOpIgOxGA+ps3OsnPWG1xnB/suqCUUO3OuAVbVCTY6hcCWRGAlQtxjEwVuZjORZ9 NtWQ== MIME-Version: 1.0 X-Received: by 10.180.7.194 with SMTP id l2mr1137447wia.39.1426627381840; Tue, 17 Mar 2015 14:23:01 -0700 (PDT) Received: by 10.27.4.198 with HTTP; Tue, 17 Mar 2015 14:23:01 -0700 (PDT) Date: Tue, 17 Mar 2015 18:23:01 -0300 Message-ID: Subject: GNU test behaviour From: =?UTF-8?Q?Robson_J=C3=BAnior?= To: bug-coreutils@gnu.org Content-Type: multipart/alternative; boundary=90e6ba614138524ebe051182928c X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 17 Mar 2015 17:25:34 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --90e6ba614138524ebe051182928c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, I'm currently very curious about something i couldn't read from man pages. `test -e ` checks if a file exists... that's why i couldn't agree with the return of the execution `test -e` with no filename being passed to. It returns 0, although it should be 1. Is it right? --=20 Robson J=C3=BAnior --90e6ba614138524ebe051182928c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,

I'm currently very curious = about something i couldn't read from man pages.

`test -e &= lt;FILENAME>` checks if a file exists... that's why i couldn't a= gree with the return of the execution `test -e` with no filename being pass= ed to. It returns 0, although it should be 1.

Is it right?

--

Robson J=C3=BAnior
--90e6ba614138524ebe051182928c-- From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 17 18:27:06 2015 Received: (at 20130) by debbugs.gnu.org; 17 Mar 2015 22:27:06 +0000 Received: from localhost ([127.0.0.1]:50456 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YXzx4-0003nl-DF for submit@debbugs.gnu.org; Tue, 17 Mar 2015 18:27:06 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:55689) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YXzx1-0003nc-V2 for 20130@debbugs.gnu.org; Tue, 17 Mar 2015 18:27:04 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 057BEA60061; Tue, 17 Mar 2015 15:27:03 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Mz1kHrzj4vxm; Tue, 17 Mar 2015 15:27:02 -0700 (PDT) Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 4B4B8A6005E; Tue, 17 Mar 2015 15:27:02 -0700 (PDT) Message-ID: <5508AA36.6080001@cs.ucla.edu> Date: Tue, 17 Mar 2015 15:27:02 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: =?UTF-8?B?Um9ic29uIErDum5pb3I=?= , 20130@debbugs.gnu.org Subject: Re: bug#20130: GNU test behaviour References: In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 20130 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) On 03/17/2015 02:23 PM, Robson Júnior wrote: > `test -e` with no filename being passed to. It returns 0, although it > should be 1. No, 'test -e' should exit with status 0, because '-e' is a nonempty string. In general, 'test X' exits with status 0 if and only if X is nonempty. POSIX requires this behavior; see: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html and search for "1 argument". From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 17 18:59:53 2015 Received: (at control) by debbugs.gnu.org; 17 Mar 2015 22:59:53 +0000 Received: from localhost ([127.0.0.1]:50680 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YY0Sn-0004nI-Ie for submit@debbugs.gnu.org; Tue, 17 Mar 2015 18:59:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33642) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YY0Sl-0004n3-Tl for control@debbugs.gnu.org; Tue, 17 Mar 2015 18:59:52 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 189408EA57 for ; Tue, 17 Mar 2015 22:59:51 +0000 (UTC) Received: from [10.3.113.11] ([10.3.113.11]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2HMxo0P003103 for ; Tue, 17 Mar 2015 18:59:50 -0400 Message-ID: <5508B1E5.8070100@redhat.com> Date: Tue, 17 Mar 2015 16:59:49 -0600 From: Eric Blake Organization: Red Hat, Inc. User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: GNU bug tracker automated control server Subject: Re: bug#20130: GNU test behaviour References: In-Reply-To: OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="cRd1JsGhwI2BK69UaSkmL4vwv8lDvi6W3" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --cRd1JsGhwI2BK69UaSkmL4vwv8lDvi6W3 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable tag 20130 notabug close 20130 thanks On 03/17/2015 03:23 PM, Robson J=C3=BAnior wrote: > Hi, >=20 > I'm currently very curious about something i couldn't read from man pag= es. >=20 > `test -e ` checks if a file exists... that's why i couldn't a= gree > with the return of the execution `test -e` with no filename being passe= d > to. It returns 0, although it should be 1. >=20 > Is it right? >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --cRd1JsGhwI2BK69UaSkmL4vwv8lDvi6W3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVCLHlAAoJEKeha0olJ0NqUOUIAKU6KhAEh5PulxtFoQZ4E/0/ aj/pqTRSrQbKfigXyOEFQ6lkws196FPYPgCDK6N10q+ykLUQKAwBBWgRsc/1LJEX s6u9CRDLOb8kfaYJwOfDfeMYDaijisBaZgvSmFAoq+iAljdPX2N4P3+A3zU1XHOW dUo/8TAGreiT7FvNIA8OhXP1atDxESSK+MYLrXdtQUfH/O/b3C6exZhUxbKaWF+7 rr4SrL/P1cwzOojAt0HCtxaRCUeGaoxDHfVPBrPXkopKEwrn2iHJmQ/6Ar6dnnVe h0LXrQ7y9qBzPXa/aXDFQAPYqGh5Ixo2mdt9N05yPmaRltcQFu7mJ9FCZC3cHLk= =fyGb -----END PGP SIGNATURE----- --cRd1JsGhwI2BK69UaSkmL4vwv8lDvi6W3-- From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 18 06:04:47 2015 Received: (at 20130) by debbugs.gnu.org; 18 Mar 2015 10:04:47 +0000 Received: from localhost ([127.0.0.1]:51032 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YYAqF-0000b4-A6 for submit@debbugs.gnu.org; Wed, 18 Mar 2015 06:04:47 -0400 Received: from mail5.vodafone.ie ([213.233.128.176]:31523) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YYAqD-0000aw-8u for 20130@debbugs.gnu.org; Wed, 18 Mar 2015 06:04:46 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiAJAOtMCVVtTCRJ/2dsb2JhbABcgwZSWoEsgRNOwm+FLEYBAgKBSkwBAQEBAQF9hBABBSMPAVYLDQsCAgUWCwICCQMCAQIBRQYBDAgBAYgvAQiwEYVplXEBCgEBAR6BIYl2hHiCaIFFBZQvh1OFQo0NI4NuPjEBgkIBAQE Received: from unknown (HELO localhost.localdomain) ([109.76.36.73]) by mail3.vodafone.ie with ESMTP; 18 Mar 2015 10:04:38 +0000 Message-ID: <55094DB5.4010607@draigBrady.com> Date: Wed, 18 Mar 2015 10:04:37 +0000 From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: =?UTF-8?B?Um9ic29uIErDum5pb3I=?= , 20130@debbugs.gnu.org Subject: Re: bug#20130: GNU test behaviour References: <5508AA36.6080001@cs.ucla.edu> In-Reply-To: <5508AA36.6080001@cs.ucla.edu> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.7 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: tag 20130 notabug close 20130 stop On 17/03/15 22:27, Paul Eggert wrote: > On 03/17/2015 02:23 PM, Robson Júnior wrote: >> `test -e` with no filename being passed to. It returns 0, although it >> should be 1. > > No, 'test -e' should exit with status 0, because '-e' is a nonempty > string. In general, 'test X' exits with status 0 if and only if X is > nonempty. POSIX requires this behavior; see: > > http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html > > and search for "1 argument". [...] Content analysis details: (2.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.7 RCVD_IN_PSBL RBL: Received via a relay in PSBL [213.233.128.176 listed in psbl.surriel.com] X-Debbugs-Envelope-To: 20130 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.7 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: tag 20130 notabug close 20130 stop On 17/03/15 22:27, Paul Eggert wrote: > On 03/17/2015 02:23 PM, Robson Júnior wrote: >> `test -e` with no filename being passed to. It returns 0, although it >> should be 1. > > No, 'test -e' should exit with status 0, because '-e' is a nonempty > string. In general, 'test X' exits with status 0 if and only if X is > nonempty. POSIX requires this behavior; see: > > http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html > > and search for "1 argument". [...] Content analysis details: (2.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.7 RCVD_IN_PSBL RBL: Received via a relay in PSBL [213.233.128.176 listed in psbl.surriel.com] tag 20130 notabug close 20130 stop On 17/03/15 22:27, Paul Eggert wrote: > On 03/17/2015 02:23 PM, Robson Júnior wrote: >> `test -e` with no filename being passed to. It returns 0, although it >> should be 1. > > No, 'test -e' should exit with status 0, because '-e' is a nonempty > string. In general, 'test X' exits with status 0 if and only if X is > nonempty. POSIX requires this behavior; see: > > http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html > > and search for "1 argument". If the filename is in a shell variable, this is another reason for quoting. I.E. this will work reliably: file=blah test -e "$file" || echo missing thanks, Pádraig. From unknown Sat Jun 21 10:07:27 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 15 Apr 2015 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator