Solved

Cross-platform shell scripting

Posted on 2007-11-26
4
735 Views
Last Modified: 2013-12-26
I was curious as to best practice for creating a cross-platform script to start an application via a command-line call, e.g., a java application. My goal is to start a java application on  Mac OS X, Linux, and Windows. My current practice is to have a .bat file for Windows, and a bash shell script for Mac and Linux, but I'd prefer a more platform-neutral means. The script would set the classpath and accept arguments which then get passed to the java application, in this instance. The app, and the script file, are both distributed to other compute nodes. Any suggestions would be greatly appreciated.
0
Comment
Question by:upton9265
4 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 63 total points
ID: 20352403
except windoze cmd.exe any shell is available on all platforms, at least following:
  bash, perl, sh, tclsh
0
 
LVL 48

Assisted Solution

by:Tintin
Tintin earned 62 total points
ID: 20352901
You have a few choices.

OS X and Linux come with bash and you can easily install bash on Windows boxes via cygwin.

Alternatively, you could write the script in Perl and then use PAR to create a single binary copy of the script to run on each platform without the need for Perl to be installed.  Note that you would need to create a binary copy for each platform though.
0
 
LVL 1

Expert Comment

by:Computer101
ID: 20632874
Forced accept.

Computer101
EE Admin
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now