From within my Scala application, I want to execute a script (e.g. setenv.sh) which sets some variables. I then want to read back these variables in my application to do some further processing. Here is my sample setenv.sh file
#!/bin/bash
TEST=0000
I have the following but it doesn't work. I tried many alternatives but failed to do it.
Seq("bash", "-c", "source setenv.sh && env").!!
The above command still gives me the old environment variables and i cannot see TEST.
My goal is to just load all the variables in setenv.sh file and use them in my application.