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.