Subject: /bin/expr has a bug
To: None <netbsd-bugs@sun-lamp.cs.berkeley.edu>
From: None <carrel@cisco.com>
List: netbsd-bugs
Date: 07/10/1994 08:27:00
>Submitter-Id: net
>Originator: David Carrel
>Organization:
Just a regular guy!
>Confidential: no
>Synopsis: colon (`:') compares don't work in /bin/expr
>Severity: non-critical
>Priority: medium
>Category: bin
>Class: sw-bug
>Release: 1.0
>Environment:
NetBSD 1.0 (supped 10 July 1994)
hp300
>Description:
expr is supposed to use the colon (`:') to indicate that a regular
expression is to be performed and print the number of matching characters.
The return status should indicate whether any match was found. But expr
ALWAYS prints `0' and returns status 1.
>How-To-Repeat:
EASY:
run "expr foo : foo"
This should print 3 and return 0, but it prints 0 and returns 1
or run "expr foo : f"
This should print 1 and return 0, but it prints 0 and returns 1
or run "expr foo : xxx"
This should print 0 and return 1, and it prints 0 and returns 1
>Fix:
Sorry, I don't have one. ;-(
------------------------------------------------------------------------------