How to adjust the job's environment for the execute machine

Known to work with HTCondor version: 7.0

One suggestion to have information from the machine be passed to the job's arguments or the job environment is to publish the information in the machine ClassAd and leave it up to the user to insert it into the job's environment via the $$() mechanism, which substitutes in values from the target ClassAd. Example machine configuration:

APP1_PATH = "/opt/app1"
APP2_PATH = "/opt/app2"
STARTD_ATTRS = $(STARTD_ATTRS) APP1_PATH APP2_PATH

Then the user can insert this information into the job environment by putting the following in the job submit file, for example:

environment = "APP1_PATH=$$(APP1_PATH) APP2_PATH=$$(APP2_PATH)"

and/or into job arguments:

arguments = "--app1=$$(APP1_PATH) --app2=$$(APP2_PATH)"

If it is expected that the job may run on machines where these attributes of the machine ClassAd are not defined, a default value should be specified like this. For example, if it should just be empty when undefined, use this:

APP1_PATH=$$(APP1_PATH:)