Solved

Cross-platform shell scripting

Posted on 2007-11-26
4
748 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

AutoHotkey is an excellent, free, open source programming/scripting language for Windows. It started out as a keyboard/mouse macros product, but has expanded into a robust language. This article provides an introduction to it, with links to addition…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

730 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