Solved

Cross-platform shell scripting

Posted on 2007-11-26
4
724 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.

747 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

13 Experts available now in Live!

Get 1:1 Help Now