This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
To create the equivilent of a .bat file on Unix, you would create a shell script. You have a choice of which shell to use. Bourne shell scripts (like the example above) normally have the suffix .sh. So you could call that shell script christopher.sh.
Korn shell scripts use the suffix .ksh (e.g., christopher.ksh). Bash shell scripts end in .bash. There are others too.
The syntax of your script will depend upon which shell you choose to use. There are lots of online resources available to help you get the syntax right.
Everybody has their own preferences. Personally, I recommend using the Korn shell.
IBM 286, SCJP, SCWCD, EIEIO
author and iconoclast
Most of the time using the Bourne shell makes the most sense (especially for something as simple as this) because everybody's guaranteed to have it. Not everybody's going to have ksh (for example, the Mandrake 10 laptop I'm typing on doesn't.) If you're writing a major application as a set of shell scripts, it's not a big deal to use one of the more exotic shells; but to make the user install ksh or zsh or whatnot just to execute your Java app is not going to win you any fans.
I wanted to make it clear that the "#!" line at the top of the script determines what shell is going to be used, not the name of the file. Using .sh is a very weak convention, if it's a convention at all, and using .ksh, .bash. .csh is weaker still. Most shell scripts (like most UNIX executables) have names with no "extension".