[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
'expr' and weird character classes
From: |
DervishD |
Subject: |
'expr' and weird character classes |
Date: |
Sun, 9 May 2004 20:02:42 +0200 |
User-agent: |
Mutt/1.4.2.1i |
Hello all :)
I'm using coreutils 5.2.1 and I've noticed a weird behaviour of
'expr'. I don't know if it's my fault, but a command like:
$ expr "x" : "[:alpha:]"
returns 0 instead of 1, but a command like:
$ expr "x" : "[[:alpha:]]"
returns 1, correctly. That is, 'expr' understands character
classes but it needs that double bracket :( This is non portable
AFAIK, at least is not SUSv3 compliant regarding basic regular
expressions, and other binaries like 'tr' or 'grep' correctly use the
single bracket character classes.
Am I doing something wrong?
Thanks a lot in advance :)
Raúl Núñez de Arenas Coronado
--
Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/
- 'expr' and weird character classes,
DervishD <=