I have a script that does some processing and then will call another relevant script. This second script may not be the same each time.
How do I call the second script from bash and have my first script wait until it is finished before it continues. I also want to run the second script in its own window.
Currently I have:
gnome-terminal -x sh second.sh
But the first script continues whilst second is running.
Your problem here is not with
bash(which processes commands in sequence unless you explicitly tell it not to using&), it’s withgnome-terminal, which hands off your execution request to a background process and then terminates the one you called.As far as I can tell, there is no way to get
gnome-terminalto behave differently. An alternative might be to usexterm, which is synchronous by default.