I have a script that connects to Openshift and launches a series of commands on PODs. Since I am working with multiple PaaS, I need to launch the script on each of them with a different connection command
If I do this in sequence all works fine but it takes a very long time so I prefer to launch all commands in parallel
Launching them in parallel in the same environment causes the connections to overwrite each other
I found this article How to run a program in a clean environment in bash? on here that seems promising, however it does not allow me to send arguments to the script I'm launching
My code looks like this at the moment:
#Get argument values
...
env -i ~/Path/To/script.sh -a1 value -a2 ${variable1} -a3 ${variable2} -- --noprofile -norc &
env -i ~/Path/To/script.sh -a1 value -a2 ${variable1} -a3 ${variable2} -- --noprofile -norc &
env -i ~/Path/To/script.sh -a1 value -a2 ${variable1} -a3 ${variable2} -- --noprofile -norc &
env -i ~/Path/To/script.sh -a1 value -a2 ${variable1} -a3 ${variable2} -- --noprofile -norc &
...
#Process resulting output
In this scenario script.sh does not seem to receive the argument values sent as variables
Any ideas on how I can get the variable arguments through knowing that I cannot write their value in the script as it is sensitive information?
Thank you all in advance,
Regards, Jean