Take the 2-minute tour ×

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/run.sh"

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 ./.....run.sh' but I've had no success through the menu. Any idea why it happens?

This is the content of the run.sh file:

./corona_run -prot tcp +maxcon 16
share|improve this question
What happens if you just use Exec=/usr/local/crontona/run.sh ? –  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/run.sh (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 "run.sh" is not executable? What does ls -la /usr/local/crontona/run.sh say? –  SirCharlo May 8 '12 at 19:20
Perhaps you need Exec=sudo /usr/local/crontona/run.sh -- 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 "run.sh" 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

1 Answer 1

Add the command read x as the last line in run.sh. 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 run.sh 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


