It's really strange:
cp003421_run> ksh -c 'x="a15 b2 c3" ; d="${x//~(X)([[:alnum:]]&[[:digit:]])+/}"
; print -v .sh.match;print $d'
(
3
3
)
a b c
cp003421_run> ksh -c 'x="a15 b2 c3" ; d="${x//~(X)([[:alnum:]]&[[:digit:]])+/
}" ; print -v .sh.match;print $d'
(
(
15
2
3
)
(
5
2
3
)
)
a b c
cp003421_run> ksh -c 'x="a15 b2 c3" ;
d="${x//~(X)(([[:alnum:]])&([[:digit:]]))+/}" ; print -v .sh.match;print $d'
(
3
3
3
3
)
a b c
cp003421_run> ksh -c 'x="a15 b2 c3" ;
d="${x//~(X)(([[:alnum:]])&([[:digit:]]))+/ }" ; print -v .sh.match;print $d'
(
(
15
2
3
)
(
5
2
3
)
(
5
2
3
)
(
5
2
3
)
)
a b c
This is from Version AJM 93u+ 2012-08-01, in Version AIJM 93v- 2013-07-24 the
commands with "/}" at the end give the same result as the commands with "/ }".
Best Regards
Axel Philipp
MTU Aero Engines AG
-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Dan Shelton
Gesendet: Dienstag, 20. August 2013 22:32
An: [email protected]; [email protected]
Betreff: [ast-users] Bug in ~(X) and .sh.match
I may have found a bug in ~(X). AFAIK the first index (.sh.match[0])
in .sh.match always lists all patterns for which matches have been
found, and all following indexes (.sh.match[0..inf]) store the
captured matches for a specific bracket pair, right?
If that's correct, why does '15' appear in .sh.match[0][0] but no
other match has '15' later?
ksh -c 'x="a15 b2 c3" ; d="${x//~(X)(([[:alnum:]])&([[:digit:]]))+/}"
; print -v .sh.match'
(
(
15
2
3
)
(
5
2
3
)
(
5
2
3
)
(
5
2
3
)
)
Dan
_______________________________________________
ast-users mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-users
--
MTU Aero Engines AG
Geschaeftsfuehrung/Board of Management: Egon W. Behle, Vorsitzender/CEO; Dr.
Rainer Martens, Michael Schreyögg, Dr. Stefan Weingartner, Reiner Winkler
Vorsitzender des Aufsichtsrats/Chairman of the Supervisory Board: Klaus
Eberhardt
Sitz der Gesellschaft/Registered Office: Muenchen
Handelsregister/Commercial Register: Muenchen HRB 157206
Diese E-Mail sowie ihre Anhaenge enthalten MTU-eigene vertrauliche oder
rechtlich geschuetzte Informationen.
Wenn Sie nicht der beabsichtigte Empfaenger sind, informieren Sie bitte den
Absender und loeschen Sie diese
E-Mail sowie die Anhaenge. Das unbefugte Speichern, Kopieren oder Weiterleiten
ist nicht gestattet.
This e-mail and any attached documents are proprietary to MTU, confidential or
protected by law.
If you are not the intended recipient, please advise the sender and delete this
message and its attachments.
Any unauthorised storing, copying or distribution is prohibited.
_______________________________________________
ast-users mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-users