cc:  [email protected]
Subject: Re: Re: [ast-users] [ksh93] [[ == ]] does not update ${.sh.match}?
--------

> But the behavior is not consistent with the =~ operator:
> 
> $ echo ${.sh.version}
> Version jM 93u 2011-02-08
> $ [[ foo =~ foo ]]
> $ ts -p .sh.match
> typeset -a .sh.match=(foo)
> $ [[ bar =~ 'bar' ]]    <== The right hand operand is quoted so it's a
> string match
> $ ts -p .sh.match
> typeset -a .sh.match=(bar)    <== but .sh.match is updated here.
> $
> 

The == operator is defined as a string match when there are no pattern
characters.

For =~ that is not the case.  For example,
        [[ bbar =~ b+ ]]
is not a string match even though it does not contain shell pattern
characters.  It is up the the regex library to know which characters
are special with ERE's. 

David Korn
[email protected]
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to