Re: expr bug
Jim Meyering <[email protected]> Wed, 28 May 2003 12:12:40 +0200
| Newsgroups | gmane.comp.gnu.sh-utils.bugs |
|---|---|
| Message-ID | <[email protected]> |
yuval <[email protected]> wrote: > On linux: > "expr match" always fails when the length of the match is 0 even > though there are cases when 0-length match should > be considered a match: > > > expr match "" " *" > > This command has output 0 and exit status 1. Thanks for the report, but that behavior is required. The `0' output string is required because that is the length of the match in this case. And whenever expr's output expression is `null or 0', then it must also exit with a status of 1. FYI, if you're still using expr from the sh-utils package, you should consider upgrading: ftp://ftp.gnu.org/gnu/coreutils/coreutils-5.0.tar.bz2 (coreutils is the union of fileutils, textutils, and sh-utils)