0
#!/usr/bin/env bash

gnome-terminal --window-with-profile=app

# Execute exe1
pathToExe1=./dir1/exe1
gnome-terminal --tab-with-profile=app -t "exe1" -- $pathToExe1

# Execute exe2
pathToExe2=./dir2/exe2
gnome-terminal --tab-with-profile=app -t "exe2" -- $pathToExe2

# Execute exe3
pathToExe3=./dir3/exe3
gnome-terminal --tab-with-profile=app -t "exe3" -- $pathToExe3

# Execute exe4
pathToExe4=./dir4/exe4
for i in 0 1 2 3 4 5 6 7
do
    arg="argValue${i}"
    gnome-terminal --tab-with-profile=app -t "exe4" -- $pathToExe4 $arg
done

I am trying to open a new terminal window which has a bunch of terminal tabs, each of which is running a executable. It won't run... What am I doing wrong? Is there anyway to do it without using profiles? When I do create a profile called "app", it opens another window, but the tabs open in the original window. Which is not right.

5
  • Please fix your script, use var=value instead of var = value or var= value. If a script is not working it is useful using set -x to get an output what is actually executed
    – pLumo
    May 28, 2020 at 15:42
  • ok I changed it. Could you please tell me why my script is not working.
    – bill greg
    May 28, 2020 at 15:59
  • Although not an answer to your original question , but it can be easily done via the "Konsole" terminal : "konsole --new-tab -e "some command" & konsole --new-tab -e "another command" & . May 28, 2020 at 16:13
  • If I run a code similar to yours in gnome-terminal , it works as you expected , but if I run it from another terminal ( like Konsole ) it will open up multiple gnome-terminal windows.I'm running ubuntu 18 . Which version do you use ? May 28, 2020 at 16:26
  • I am using ubuntu 18 as well (I am using gnome-terminal)
    – bill greg
    May 28, 2020 at 17:32

1 Answer 1

0

I think your script hangs waiting for the first gnome-terminal command to finish.

Try to add a space then & at the end of each gnome-terminal line, so the shell will not wait there and continue.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .