bug-bash
[Top][All Lists]
Advanced

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

Re: test builtin and '-l'


From: Chet Ramey
Subject: Re: test builtin and '-l'
Date: Mon, 25 Nov 2002 10:01:56 -0500

> Machine Type: i686-pc-linux-gnu
> 
> Bash Version: 2.05b
> Patch Level: 0
> Release Status: release
> 
> Description:
>       'test -l ab -eq 2' gives an error, but '/usr/bin/test ab -eq
>       2' gives success.  I'm told this used to work (but haven't
>       verified it).

It's not a bug.

Historical versions of `test', including the version built into earlier
versions of the System V sh, used that `operator' to calculate string
length.  It's no longer needed now that we have the ${#paramter} expansion,
and it screws up the grammar.

It's not in the POSIX.2 spec for `test', and bash no longer supports it
(and has not for quite a while).

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )

Chet Ramey, ITS, CWRU    chet@po.CWRU.Edu    http://cnswww.cns.cwru.edu/~chet/




reply via email to

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