[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [HTCondor-users] Complex conditionals in Configuration
- Date: Mon, 6 Jun 2022 14:38:07 +0000
- From: John M Knoeller <johnkn@xxxxxxxxxxx>
- Subject: Re: [HTCondor-users] Complex conditionals in Configuration
You need to use a temporary variable to hold the condition, and then use $EVAL or $INT when you reference it, like this.
MY_CONDITION = $(MY_OPTION) == "one"
The limitation here is that the $() expansion parser doesn't allow a $ inside the body of a $() or $func() macro reference, so you need to set things up so that is avoided. To assist in this $INT(), $STRING() and $EVAL() expect their argument to be a variable that contains an expression, not the expression itself.
From: HTCondor-users <htcondor-users-bounces@xxxxxxxxxxx> On Behalf Of Stanislav V. Markevich via HTCondor-users
Sent: Sunday, June 5, 2022 4:10 PM
Cc: Stanislav V. Markevich <stanislav.markevich@xxxxxxxxxxxxxx>
Subject: [HTCondor-users] Complex conditionals in Configuration
I'm trying to check value of some macro in a condition and cannot understand how should I do it.
If the macro evaluates to a simple boolean value (true, false, 0, 1, etc) there is no problem. But what if I want to compare with other values?
For example, I want to check if $(MY_OPTION) evaluates to the value "one". I cannot just write
if $(MY_OPTION) == "one"
because of complex conditionals are not supported. So I have somehow evaluate this expression and put the result into some other macro, but how can I do it?
MY_CONDITION = $EVAL( $(MY_OPTION) == "one")
and some other options but still get the same error "$(MY_CONDITION) is not a valid if condition because complex conditionals are not supported".
Any help would be greatly appreciated.
Stanislav V. Markevich
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
You can also unsubscribe by visiting
The archives can be found at: