0

Trying to run a bash script to open a new terminal window that runs a simple ls command in it.

I've tried different permutations of...

gnome-terminal --window -e ls
gnome-terminal --window -- ls
gnome-terminal --window [-e, ls]
gnome-terminal -- -e ls
gnome-terminal [-e, --command=ls]
gnome-terminal -- ls

I've tried so many more combinations. I've gone over the man and --help files and can't seem to understand how to use the -e option correctly. I've read many of the posts here on SO. The post that is linked as an answer does NOT have usable information that I could use to make the ls command run in a new terminal window.

When executing the ./file I would like my bash script to use the gnome-terminal command to open a new terminal window and run the ls command in it.

But while attempting to use the -e option I get this error:

# Option “-e” is deprecated and might be removed in a later version of gnome-terminal.
# Use “-- ” to terminate the options and put the command line to execute after it.

or sometimes a new terminal will open with an error message that says...

There was an error creating the child process for this terminal 
...Failed to execute child process “ls” (No such file or directory)

I believe the information on Stack Overflow about this subject is outdated, as all the posts I could find are years old and offer answers that generate errors for me. Please help.

Marcvs
  • 35
  • 5
  • How is this question already answered? There is no information on how to make gnome-terminal open a new window and run a command in it. the link offered as the answer to my question does not have any answers. I still have no idea how to make gnome-terminal open a new window and run a basic command in it. – Marcvs Jun 09 '19 at 07:26
  • _" believe the information on Stack Overflow about this subject is outdated,"_ possibly, but your question itself is off-topic as it is not a programming question. – Mark Rotteveel Jun 09 '19 at 11:29
  • What topic should I have submitted this under? – Marcvs Jun 10 '19 at 04:39
  • Possibly on https://unix.stackexchange.com/ or https://superuser.com/ – Mark Rotteveel Jun 10 '19 at 06:43

0 Answers0