1

Sorry if my title is a little hard to understand, I tried to condense the issue as much as possible.

I'm trying to run a bash script which opens a new terminal for each major command, that way I can see the info the program is telling me. Problem is, the script only opens the new terminal for the next line of script when the previous terminal is closed (which is not an option for this application). To make it abundantly clear, I need all 3 terminals open at the same time.

Running each line of code individually from the terminal works but obviously that defeats the purpose of the script. Here is my code:

#!/bin/bash
gnome-terminal -x /bin/bash haguichi -d
cd /home/reed/StarMade
gnome-terminal -x java -jar StarMade.jar -force
gnome-terminal -x ./StarMade-dedicated-server-linux.sh

I've also tried adding -s and -m to see if it would work, but it just broke the code completely. Help?

EDIT: I fixed the error by adding & at the end of the lines. Thanks for your help!

  • What happens if you end all gnome-terminal commands with a "&"? – Jos Jan 20 '15 at 16:02
1

Try adding an ampersand at the end of the lines to put processes into background.

#!/bin/bash
gnome-terminal -x /bin/bash haguichi -d &
cd /home/reed/StarMade
gnome-terminal -x java -jar StarMade.jar -force &
gnome-terminal -x ./StarMade-dedicated-server-linux.sh &

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.