bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#9211: test -l


From: Bob Proulx
Subject: bug#9211: test -l
Date: Sun, 31 Jul 2011 18:22:11 -0600
User-agent: Mutt/1.5.21 (2010-09-15)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]