Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Cross-platform shell scripting

Posted on 2007-11-26
4
Medium Priority
?
808 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 252 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 248 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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Utilizing an array to gracefully append to a list of EmailAddresses
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…
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…

596 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