[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



In 8.4 you can use $INT and a temporary variable like this. 

mypath = $ENV(MY_PATH)
mypath_is_udefined = "$(mypath)"=="UNDEFINED"
if $INT(mypath_is_undefined)
  mypath = /default/path
endif

-----Original Message-----
From: HTCondor-users [mailto:htcondor-users-bounces@xxxxxxxxxxx] On Behalf Of Marco Mambelli
Sent: Thursday, September 1, 2016 12:15 PM
To: htcondor-users@xxxxxxxxxxx
Subject: [HTCondor-users] Default value for attributes from environment variables in submit file

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/