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

Re: [HTCondor-users] Default value for attributes from environment variables in submit file



Hi Marco,

Is this what you're aiming for:

+path_tmp = "$ENV(VAR_NAME)"
+path_val = "$$(path_tmp:bar)"

Note that $$ is only evaluated at match time.

Brian

> On Sep 1, 2016, at 12:15 PM, Marco Mambelli <marcom@xxxxxxxx> wrote:
> 
> Hi all,
> in a submit file I can refer to the environment using
> $ENV(VAR_NAME)
> If this is unset ENV returns UNDEFINED.
> Iâd like to have a default value.
> 
> All that I tried is not working:
> 1- this is not valid. Is interpreted as string:
> $ENV(MY_PATH:/default/path)
> 
> 2- this gives UNDEFINED (MY_PATH is not set. If set this works)
> path_attribute = $ENV(MY_PATH)
> path_with_default = $(path_attribute:/default/path)
> 
> 3- this expression is not evaluated (holds job):
> path_attribute = $ENV(MY_PATH)
> path_with_default = $$([isUndefined(path_attribute)])
> 
> 
> Is it there any way to have an attribute with the content of MY_PATH if this is set and a default value if this is not set?
> 
> Thank you,
> Marco
> 
> _______________________________________________
> 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/