I am trying to make it easier to run a program which currently involves running multiple separate scripts. I just want to be able to run one .sh file which will then open multiple terminal windows and execute separate scripts in each window. I am having a problem now though where the scripts appear to be running (when I close the terminal windows it informs me that there is a process running), but nothing is being printed to the screen / console. It almost looks like the processes are being run silently in the background. I have simplified the program / scripts here to isolate the issue that I am having.
Here is the main shell script that is being used to call the others:
---main_script.sh---
echo "run my program"
gnome-terminal -- ~/Path/To/program_script_1.sh
sleep 2
gnome-terminal -- ~/Path/To/program_script_2.sh
And here are the two program scripts being called from the main script:
---program_script_1.sh---
bash
conda activate MyEnv
echo "do the first thing"
sleep 1
echo "done"
---program_script_2.sh---
bash
conda activate MyEnv
echo "do the second thing"
sleep 1
echo "done"
all of the shell scripts are in the same folder / directory.
When I run main_script.sh
, it runs successfully, but it doesn't print anything to the console, so it's as if the programs are running in the background.
I think that the issue may be related to the fact that I am calling bash
within the shell script, but this is necessary in order to be able to load my conda environment.
Here are some screenshots showing what it looks like after running (notice that there is no text output in the 2 program scripts):