[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#5812: expr: Difference in behavior of match and :
From: |
Eric Blake |
Subject: |
bug#5812: expr: Difference in behavior of match and : |
Date: |
Wed, 31 Mar 2010 15:48:56 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc12 Lightning/1.0b1 Thunderbird/3.0.3 |
On 03/31/2010 07:05 AM, Adil Mujeeb wrote:
> Hello team,
>
> I have tried following snippet in a bash script:
>
> -bash-3.1$userid=`expr "uid=11008(ADILM) gid=1200(cvs),1400(build)" :
> ".*uid=[0-9]*(\(.[0-9a-z]*\)) .*"`
> -bash-3.1$echo $userid
> ADILM
> -bash-3.1$
I cannot repeat your results with 7.6 (the version in fedora 12) or the
latest coreutils.git.
$ expr "uid=11008(ADILM) gid=1200(cvs),1400(build)" : \
".*uid=[0-9]*(\(.[0-9a-z]*\)) .*"
$ expr "uid=11008(ADILM) gid=1200(cvs),1400(build)" : \
".*uid=[0-9]*(\(.[0-9a-zA-Z]*\)) .*"
ADILM
Perhaps you have a locale issue at play?
> -bash-3.1$ rpm -qf /usr/bin/expr
> coreutils-5.97-12.1.el5
That's rather old. Perhaps it might be a bug that has been fixed in the
meantime, in which case, you would want to upgrade to 8.4.
At any rate, there's nothing in the source code that introduces any case
insensitivity, and the documentation is correct, that match and : behave
identically.
--
Eric Blake address@hidden +1-801-349-2682
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature