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

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



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