Show a terminal, execute a command in it?

I have a command in a .sh script that in my previous Linux showed a program menu in a terminal. However - upon executing it in ZorinOS, no terminal window shows up.

#!/bin/bash
terminal -e MY COMMAND

As I checked - other commands in .sh script work, but this one requires terminal to be "physically" opened - as a window.

Do you understand my request - and maybe know a solution?

Have you tried with sh -c "terminal -e MY COMMAND" instead of a script?
Try also put a sleep 100 so thee DE gets started up before executing the script.

Right click on the .sh file and go to properties. There you can change the file to be executable. That should let you just click on the file and then select "run in terminal".

Have you tried with sh -c "terminal -e MY COMMAND" instead of a script?
Try also put a sleep 100 so thee DE gets started up before executing the script.

sh -c "terminal -e MY COMMAND"* did not work.
Its not a startup script, so I think desktop environment (if thats what you mean by DE) startup has nothing to do with it.

Right click on the .sh file and go to properties. There you can change the file to be executable. That should let you just click on the file and then select "run in terminal".

It was already executable. But clicking it and selecting open with -> terminal worked! So it is partially solved, but I would just love to do a brainless "double click the .sh and terminal pops up". Do you think its achievable?

If I understand your first post you have some .sh files that you can just double click on and they open in terminal. Is that correct? If so you could look at the properties of those files and see if you see something different between them and the file you want to get working that way. I don't think I have any .sh files that will automatically go to terminal by double clicking them. But I am still learning a lot about Linux and how everything works. I only a couple of weeks ago learned how to make a .sh file executable.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.