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

Which are the .bat file alternatives for Linux, MacOSX and other operating systems for starting a jar file for example or another program (.exe, .app ...) with a click on this .bat / ... file?

I just know .sh, but which operating systems support it natively?

Like the .sh file. Which files work under which OS natively without any external dependencies or libraries (like python)

share|improve this question
up vote 1 down vote accepted

Bash works on Linux, MacOSX, BSD and some other unixes usually. How you name the file doesn't really matter, but most people would call it .sh. The important part is that the first line of the file is this:


And the file has to be executable, like with chmod +x.

share|improve this answer
they have to set it manually as executable? – Daniel Ruf Feb 20 '13 at 16:07
Not recognize as default on windows for sure. – Gilles Quenot Feb 20 '13 at 16:09
for windows there is .bat or what do you mean sputnick? – Daniel Ruf Feb 20 '13 at 16:09

Try doing this :

to run it in a wrapper (should works on any platforms):

execlp("java", "java", "-jar", "myprog.jar", (char *)0);
share|improve this answer
just bash script, I dont want to compile for each platform a new file. Also they should be able to change / edit the files so bash seems to be the best – Daniel Ruf Feb 20 '13 at 16:07

You must log in to answer this question.

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