Super User is a question and answer site for computer enthusiasts and power users. 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 changed the permissions of an sh file, so that I can read, write and execute it. I double-clicked it, selected run in Shell / terminal (whichever appears in english), but it didn't run. I double-clicked it, selected run, but it didn't run.

bash *filename* runs it
sh *filename* runs it

The file content is:


# get dirsyncpro home
DIRSYNCPRO_HOME="$(dirname $0)"

# start programm and pass any parameters
java -Xmx512M -jar "$DIRSYNCPRO_HOME/dirsyncpro.jar" $* 

Works in this person's computer:

What's going on?

share|improve this question

Your test is wrong, you must be able to run it without first calling another shell.


And not


Also double check that the permissions actually is correct.

chmod 755
share|improve this answer

Your problem is that when you try to run your shell script by double clicking it, your system by default will run it in your home directory.

When arriving at the line

# start programm and pass any parameters
java -Xmx512M -jar "$DIRSYNCPRO_HOME/dirsyncpro.jar" $* 

The DIRSYNCPRO_HOME folder is not the folder you expect, your jar file is not found and the application will silently stop. I think if you hardcode the value of DIRSYNPRO_HOME you should be able to run your shell script with doubleclicking it.

share|improve this answer

In Ubuntu, "Terminal" doesn't really exist. On my install (9.10) I get this:

The program 'Terminal' is currently not installed. You can install it by typing: sudo apt-get install Terminal: command not found

I'm not sure if that is the case for you, but if it is try changing the select from "Termianl" to "gnome-terminal".

share|improve this answer
i think "Terminal" in this context is a Gnome/freedesktop capability, not a specific application. similar to Apt's concept of virtual packages, gnome-terminal and urxvt and other packages "provide" the Terminal capability. my karmic VM is currently offline but i think such capabilities are defined in the *.desktop files under /usr/share/applications or similar. – quack quixote Apr 15 '10 at 3:20
Terminal in brazilian porguese may be Shell in american english. It's where you type Linux commands. – Delirium tremens Apr 15 '10 at 14:04
@Delirium: no, shell is something different. terminal is what displays the output of command-line programs; shell is what provides and interprets the command-line. gnome-terminal and PuTTY are terminals; bash and tcsh are shells. where you type linux commands generally includes both a shell and a terminal. – quack quixote Apr 15 '10 at 14:10
Googling for double click sh results in "I could run the script from terminal." -… "You'd run in in a terminal." - "Its intended to be used through terminal:" - "how can I make it so that it runs in a terminal" -… People are using Terminal all the time. How come it's wrong? – Delirium tremens Apr 15 '10 at 14:19
@Delirium: they're just two closely related, but distinctly different things. the terminal gives you a window to run the shell in; the shell interprets your command and runs other programs; the terminal displays what those programs output. – quack quixote Apr 15 '10 at 14:38
up vote 0 down vote accepted

The dirsyncpro readme says that it must be run by command-line in all non-Windows operating systems. I was avoiding running the jar file, but there's no other way.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .