Search code examples
windowslinuxscriptingmultiplatform

cross-platform scripting for windows, Linux, MacOS X


I'm looking for cross-platform scripting (language) for windows, Linux, MacOS X. I'm tired of .bat / bash .

I would like to do things like for example ,,lock workstation'' at automatic login (I had this in X-Window but the solution was pretty ugly; now, I would like that on MS Windows and not that ugly :-) ).
Generally: automate tasks.

Or would I be better off with Windows Scripting Host?
PowerShell also comes to mind, but that's seems to Windows-only for my taste. Can languages like Python, Ruby, (Java?) interact (elegantly? sensibly?) with WSH?

Also things like DBUS, DCOM, etc come to mind as part of the picture.

Currently I use a mixture of Java, .bat, bash, Ruby, Scala; some VBA for Excel. Which sometimes gets pretty ugly.

I would like a cross-platform general solution with/using ,,native'' parts close to OS-specifics. Like e.g. Ruby driving some Windows-specific stuff (just a guess).
What do You use?
TIA


Solution

  • I think you're juggling on the edge of contradictory: you would like platform-independent (commendable) but also "close to OS specifics".

    If, however, you put a bit more emphasis on platform independence, I've been entertaining the idea of using groovy (a more java-friendly relative of ruby) for general purpose scripting. When you need it, you get OS-specific behaviour by invoking OS shell commands.

    My motivation is a bit different: I find groovy code to be more robust than that of bash, although I too will need a good multi-platform scripting tool for a project I'm developing.