You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a job that needs to run on multiple systems repeatedly, but each system has a specific environmental variable that needs to be set when the job is run. Currently I have four separate jobs, but would like to combine this into one multiplex job. Is there a way I can set this environmental variable per host when running the multiplex job?
The text was updated successfully, but these errors were encountered:
You can achieve this by using the shell plugin and some if-then clauses:
#!/bin/bash
export VAR=0
if [[ $(hostname -a) == "server01" ]]; then
export VAR=1
fi
if [[ $(hostname -a) == "server02" ]]; then
export VAR=2
fi
if [[ $(hostname -a) == "server03" ]]; then
export VAR=3
fi
echo $VAR
works for me. depending on the executing server, the correct variable is output.
I have a job that needs to run on multiple systems repeatedly, but each system has a specific environmental variable that needs to be set when the job is run. Currently I have four separate jobs, but would like to combine this into one multiplex job. Is there a way I can set this environmental variable per host when running the multiplex job?
The text was updated successfully, but these errors were encountered: