[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 ð


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'
[Â ]
# confirm that a non-matching string results in true
$ classad_eval 'MyAttr = "strbar"' '(False || regexp(MyAttr, "strfoo")) =!= True'
[ MyAttr = "strbar" ]
# confirm that a matching string results in false
$ classad_eval 'MyAttr = "strfoo"' '(False || regexp(MyAttr, "strfoo")) =!= True'
[ MyAttr = "strfoo" ]

-- 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

The archives can be found at:

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