[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HTCondor-users] class ad logic with undef (non-)equal



Hi Todd,

ah, you are right: `=!=` should catch my cases as well - I totally forgot about it ð

Cheers,
  Thomas

On 12/05/2021 17.18, Todd L Miller wrote:
So, one question would be, if there is a `?`-like operator for a boolean non-equal comparison, that resolves in false when compared to undef?

ÂÂÂÂIf I understood your question correctly, you could also rewrite your expression with =!=, it would seem:

( Expr1 || regexp(MyAttr, "strfoo") ) =!= true

# an undefined left-hand side is false
$ classad_eval '' '(False || regexp(MyAttr, "strfoo")) =!= True'
[Â ]
true
# confirm that a non-matching string results in true
$ classad_eval 'MyAttr = "strbar"' '(False || regexp(MyAttr, "strfoo")) =!= True'
[ MyAttr = "strbar" ]
true
# confirm that a matching string results in false
$ classad_eval 'MyAttr = "strfoo"' '(False || regexp(MyAttr, "strfoo")) =!= True'
[ MyAttr = "strfoo" ]
false

-- ToddM
_______________________________________________
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users

The archives can be found at:
https://lists.cs.wisc.edu/archive/htcondor-users/

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature