1

The following bash script is suppose to open 2 new terminal tabs then execute respective commands:

mate-terminal --tab -e "cd ~/ece344/root; sys161 -w kernel" --tab -e "cd ~/ece344/root; cs161-gdb kernel"

The script does open 2 new tabs however both tabs display the following error:

There was an error creating the child process for this terminal
Failed to execute child process "cd" (No such file or directory)

Ps. The answer should work with mate-terminal.

1 Answers1

1

I don't have mate installed but I would try :

mate-terminal --tab -e "/bin/bash -c 'cd ~/ece344/root; sys161 -w kernel'" --tab -e "/bin/bash -c 'cd ~/ece344/root; cs161-gdb kernel'"

The idea is that "-e" would want to execute a command that probably run inside the window instead of a default shell, so from the error I understand that "cd" is not a real program in an expected location (since 'cd' is in the PATH shouldn't be a problem. So my example would provide a full path to a shell "/bin/bash" that would then execute the commands you want.

czvtools
  • 591
  • 2
  • 7
  • Is produces the same error except now its `"Failed to execute child process "bin/bash" (No such file or directory)"` –  Sep 16 '17 at 20:31
  • That error message suggests you wrote `-e "bin/bash ..."`, not `-e "/bin/bash ..."`. – chepner Sep 16 '17 at 20:37
  • In my case I wanted to have the terminal stay open... https://stackoverflow.com/questions/25351454/open-multiple-terminal-tabs-execute-commands-and-continue-working-on-them – poleguy May 09 '22 at 20:03