I'm kind of confused, I thought doing something like this would work :


wget https://myscript.sh
chmod +x myscript.sh
exec gnome-terminal --tab --active --title="my title" -- myscript.sh

But running this returns :

error message in terminal

There was an error creating the child process for this terminal

Failed to execute child process "myscript.sh" (No such file or directory)

Removing exec doesn't work I also tried putting the file name in between $( ) and " ", I also tried putting the absolute path.

What am I doing wrong?

  • Is your goal to crash the system with recursive file loading and processing? – Penguino Jul 18 at 22:33

The correct syntax is :

gnome-terminal --tab --active --title="my title" -- "/tmp/myworkdir/myscript.sh"

having an absolute path will allow for the file to be run.

make sure to makes all your file operations happen in this same directory.

  • That just means that myscript.sh either doesn't have a shebang line or isn't executable or both. – terdon Jul 19 at 11:41
  • I just did, and a script with #!/bin/bash as the first line, and then echo foo; sleep 100 will run fine with gnome-terminal --tab --active --title="my title" -- foo.sh. It actually fails with bash foo.sh! – terdon Jul 19 at 12:40
  • Tried both, no difference. Are you sure you have a correct shebang line? – terdon Jul 19 at 13:08
  • Let us continue this discussion in chat. – terdon Jul 19 at 13:58
  • IMO it should be gnome-terminal --tab --active --title="my title" -- bash -c "/path/myscript.sh; exec bash", reference: askubuntu.com/a/974782/566421 – pa4080 Jul 19 at 15:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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