GNU bug report logs - #9211
test -l

Previous Next

Package: coreutils;

Reported by: Clifton Ray Hodges <desk <at> clifton-hodges.com>

Date: Sun, 31 Jul 2011 22:48:02 UTC

Severity: normal

Tags: notabug

Done: Bob Proulx <bob <at> proulx.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Clifton Ray Hodges <desk <at> clifton-hodges.com>
Subject: bug#9211: closed (Re: bug#9211: test -l)
Date: Mon, 01 Aug 2011 00:23:03 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#9211: test -l

which was filed against the coreutils package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 9211 <at> debbugs.gnu.org.

-- 
9211: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9211
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Bob Proulx <bob <at> proulx.com>
To: Clifton Ray Hodges <desk <at> clifton-hodges.com>
Cc: 9211-done <at> debbugs.gnu.org
Subject: Re: bug#9211: test -l
Date: Sun, 31 Jul 2011 18:22:11 -0600
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

[Message part 3 (message/rfc822, inline)]
From: Clifton Ray Hodges <desk <at> clifton-hodges.com>
To: bug-coreutils <at> gnu.org
Subject: test -l
Date: Sun, 31 Jul 2011 10:07:36 -0400
[Message part 4 (text/plain, inline)]
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


[Message part 5 (text/html, inline)]

This bug report was last modified 13 years and 299 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.