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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 9211 in the body.
You can then email your comments to 9211 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#9211; Package coreutils. (Sun, 31 Jul 2011 22:48:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Clifton Ray Hodges <desk <at> clifton-hodges.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Sun, 31 Jul 2011 22:48:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

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 1 (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 2 (text/html, inline)]

Added tag(s) notabug. Request was from Bob Proulx <bob <at> proulx.com> to control <at> debbugs.gnu.org. (Mon, 01 Aug 2011 00:23:02 GMT) Full text and rfc822 format available.

Reply sent to Bob Proulx <bob <at> proulx.com>:
You have taken responsibility. (Mon, 01 Aug 2011 00:23:02 GMT) Full text and rfc822 format available.

Notification sent to Clifton Ray Hodges <desk <at> clifton-hodges.com>:
bug acknowledged by developer. (Mon, 01 Aug 2011 00:23:03 GMT) Full text and rfc822 format available.

Message #12 received at 9211-done <at> debbugs.gnu.org (full text, mbox):

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




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 29 Aug 2011 11:24:03 GMT) Full text and rfc822 format available.

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.