1

Relative to same problem of Run Mono Application on Startup with Upstart, here this something that I don't understand: In "startup applications", (1) I added a new program (Terminal) with the command:

gnome-terminal 

Ok, the terminal opens on Ubuntu startup. (2) Then I changed the command to:

gnome-terminal -e nano /home/user/Documents/test.txt

Ok, the terminal opens with nano editor. (3) Then I changed the command to:

gnome-terminal -e /usr/bin/mono /usr/lib/IndsysAndon/IndsysAndon.exe

And the terminal opens and closes after 1 second, without run de application. But, when I pastes the command of (3) in a terminal opened in (1), the application runs. Why this happens? Is needed a time to load all dependencies in startup? Thanks

Community
  • 1
  • 1
Jeferson Preti
  • 57
  • 2
  • 12
  • Good question, but its fitness here is dubious. You might have better luck at http://askubuntu.com/. – Kirk Woll Oct 04 '13 at 23:06
  • Try putting quotes around the command, ie. `gnome-terminal -e "/usr/bin/mono /usr/lib/IndsysAndon/IndsysAndon.exe"` – Jester Oct 05 '13 at 00:26
  • Incredible Jester, it works!!!! Thank you very much! If you want, answer the question and I finalizes this post marking your answer. For curiosity, what diference with or whithout quotes? – Jeferson Preti Oct 05 '13 at 01:03

1 Answers1

1

gnome-terminal expects the command to execute, along with any arguments, as a single string passed via the -e option. If you write

gnome-terminal -e foo bar

then the command to run will be foo and the bar will be considered an argument to gnome-terminal itself. (Remember that options can appear in any order.)

If you want to pass arguments to the command, you will need to make sure they are passed as a single string to gnome-terminal. You can do that by quoting:

gnome-terminal -e "foo bar"

Unfortunately gnome-terminal doesn't use a more user-friendly way, where any subsequent arguments after the command would automatically be considered arguments to the program and not to gnome-terminal.

Jester
  • 56,577
  • 4
  • 81
  • 125