Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've created a desktop entry in ~/.local/share/applications. It looks similiar to the following:

[Desktop Entry]
Name=Crontona Server
GenericName=CA Server
Comment=BDAF server for Crontona
Exec=bash "/usr/local/crontona/"

It show's up in the Unity launcher and everything, but whenever I click it, the terminal just pops up but instantly closes. I have no problems at all with using 'bash ./' but I've had no success through the menu. Any idea why it happens?

This is the content of the file:

./corona_run -prot tcp +maxcon 16
share|improve this question
What happens if you just use Exec=/usr/local/crontona/ ? – glenn jackman May 8 '12 at 18:59
Hmm... "There was an error creating the child process for this terminal. Failed to execute child process /usr/local/crontona/ (Permission denied)". Seems like a permission problem... Then, how do I execute 'with' permission through a desktop shortcut? – Elliott Darfink May 8 '12 at 19:03
Perhaps "" is not executable? What does ls -la /usr/local/crontona/ say? – SirCharlo May 8 '12 at 19:20
Perhaps you need Exec=sudo /usr/local/crontona/ -- I'm not familiar with these, so I don't know if you need quotes. – glenn jackman May 8 '12 at 19:23
Ok.. Does the "" file have the appropriate shebang and path to the bash interpreter on the first line? For example: #!/bin/bash – SirCharlo May 8 '12 at 20:25

Add the command read x as the last line in This read will cause the command window to remain open until you press return. If any messages are displayed this gives time to read them.

The read is the key. Here is a shell script (I prefer it to bash although bash is becoming as popular). BTW, the .sh at the end means shell script, not script. You could change your launcher Exec option to:


And use the following script...

./corona_run -prot tcp +maxcon 16
echo -n Press enter to end...
read x
echo Ending Now\!

Notice I escaped the ! in the Ending Now. That last line is not needed unless you are running the script inside a terminal and want to have it echo execution. This way, if the terminal appears and the script is run inside the terminal, the script will not exit until you press enter so the terminal cannot close until you are ready.

share|improve this answer
Or, in the .desktop-file, Exec=bash -c '/path/to/script; read -p "Hit enter to close"' – geirha Jul 27 '12 at 15:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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