From unknown Thu Aug 14 12:22:28 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#9211 <9211@debbugs.gnu.org> To: bug#9211 <9211@debbugs.gnu.org> Subject: Status: test -l Reply-To: bug#9211 <9211@debbugs.gnu.org> Date: Thu, 14 Aug 2025 19:22:28 +0000 retitle 9211 test -l reassign 9211 coreutils submitter 9211 Clifton Ray Hodges severity 9211 normal tag 9211 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 31 18:47:50 2011 Received: (at submit) by debbugs.gnu.org; 31 Jul 2011 22:47:50 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QnenV-0006ts-5B for submit@debbugs.gnu.org; Sun, 31 Jul 2011 18:47:50 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QnWgF-0008Rk-SM for submit@debbugs.gnu.org; Sun, 31 Jul 2011 10:07:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QnWfy-0000Z4-DM for submit@debbugs.gnu.org; Sun, 31 Jul 2011 10:07:31 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:44695) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QnWfy-0000Z0-BS for submit@debbugs.gnu.org; Sun, 31 Jul 2011 10:07:30 -0400 Received: from eggs.gnu.org ([140.186.70.92]:58521) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QnWfx-0006Tb-D3 for bug-coreutils@gnu.org; Sun, 31 Jul 2011 10:07:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QnWfw-0000YY-Cj for bug-coreutils@gnu.org; Sun, 31 Jul 2011 10:07:29 -0400 Received: from vms173005pub.verizon.net ([206.46.173.5]:56399) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QnWfw-0000YF-7P for bug-coreutils@gnu.org; Sun, 31 Jul 2011 10:07:28 -0400 Received: from [192.168.1.42] ([unknown] [108.15.219.15]) by vms173005.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0LP70049HB7YZ5Y2@vms173005.mailsrvcs.net> for bug-coreutils@gnu.org; Sun, 31 Jul 2011 09:07:11 -0500 (CDT) Message-id: <4E3561A8.40009@clifton-hodges.com> Date: Sun, 31 Jul 2011 10:07:36 -0400 From: Clifton Ray Hodges User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110616 SUSE/3.1.11 NOT Firefox/3.5 Lightning/1.0b2 Thunderbird/3.1.11 MIME-version: 1.0 To: bug-coreutils@gnu.org Subject: test -l Content-type: multipart/alternative; boundary=------------060304050709000705060302 X-detected-operating-system: by eggs.gnu.org: Solaris 10 (1203?) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -6.6 (------) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 31 Jul 2011 18:47:48 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) This is a multi-part message in MIME format. --------------060304050709000705060302 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi, In the test manual for the 'test' command, it states that: "INTEGER may also be -l STRING, which evaluates to the length of STRING" and even in the info page it gives an example of: test -l abc -gt 1 && echo yes but that command, as well as any in scripts, reports an error of: bash: test: -l: unary operator expected This has been the case since as far back as least the summer of 2009 when after I shortly started using a Linux Operating System - that was PCLinuxOS back then, but now I am using openSUSE in the past year (currently version 11.4 KDE). Regards, Clifton --------------060304050709000705060302 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi,

In the test manual for the 'test' command, it states that:
"INTEGER may also be -l STRING, which evaluates to the length of STRING"
and even in the info page it gives an example of:

test -l abc -gt 1 && echo yes

but that command, as well as any in scripts, reports an error of:

bash: test: -l: unary operator expected

This has been the case since as far back as least the summer of 2009 when after I shortly started using a Linux Operating System - that was PCLinuxOS back then, but now I am using openSUSE in the past year (currently version 11.4 KDE).

Regards,
Clifton


--------------060304050709000705060302-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 31 20:22:36 2011 Received: (at control) by debbugs.gnu.org; 1 Aug 2011 00:22:36 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QngHE-0000g0-09 for submit@debbugs.gnu.org; Sun, 31 Jul 2011 20:22:36 -0400 Received: from joseki.proulx.com ([216.17.153.58]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QngH9-0000fm-UC; Sun, 31 Jul 2011 20:22:32 -0400 Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id EB54921361; Sun, 31 Jul 2011 18:22:11 -0600 (MDT) Received: by hysteria.proulx.com (Postfix, from userid 1000) id C5C262DC7C; Sun, 31 Jul 2011 18:22:11 -0600 (MDT) Date: Sun, 31 Jul 2011 18:22:11 -0600 From: Bob Proulx To: Clifton Ray Hodges Subject: Re: bug#9211: test -l Message-ID: <20110801002211.GA30741@hysteria.proulx.com> References: <4E3561A8.40009@clifton-hodges.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4E3561A8.40009@clifton-hodges.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -2.5 (--) X-Debbugs-Envelope-To: control Cc: 9211-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.5 (--) tag 9211 + notabug thanks Clifton Ray Hodges wrote: > In the test manual for the 'test' command, it states that: > "INTEGER may also be -l STRING, which evaluates to the length of > STRING" > and even in the info page it gives an example of: > > test -l abc -gt 1 && echo yes Note that it isn't standard. It is a coreutils extension. > but that command, as well as any in scripts, reports an error of: > > bash: test: -l: unary operator expected The error line tells all. It says "bash: test" and that is the bash test and not the coreutils test. $ type test test is a shell builtin To get the coreutils test you would need to force it to be an external command. $ /usr/bin/test -l abc -gt 1 && echo yes yes Bob From unknown Thu Aug 14 12:22:28 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 29 Aug 2011 11:24:03 +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