Porting Windows Batch (BAT) to Mac OS X shell scripts (SH) ?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Voodooman
Posts: 12
Joined: 25 Sep 2011 07:45

Porting Windows Batch (BAT) to Mac OS X shell scripts (SH) ?

#1 Post by Voodooman » 21 Jul 2012 03:25

Help needed!

I used to rely on bat scripts wrapped into exe launcher heavily and use them to avoid messing with visual studio and coding when i need to make some simple programs.
So in this case i only notepad++, exe wrapper and maybe few extra command line tools if such function not supported by cmd by default.

But this time i need to port my bat script to Mac OS X (and preferably to wrap them into some launcher), and i dont know a thing about how to do this and what behavior i should expect and how things works on macs these days.

I found this document http://www.macs.hw.ac.uk/~hwloidl/docs/ ... batch.html
about conversion of some common commands,
and this
https://developer.apple.com/library/mac ... ction.html

Well i can figure something out with this, but im thinking about another problem - i use modified rar sfx executables for installers and few more purposes, and i cant find any equivalent of this for mac, also as part of interface i use buil-in Tridend (mshtml) frame which acts like IE within UI (especially useful for making non system default looking scrollbars).
So im thinking how i could combine sh, bat and exe with some Wine-powered exe wrapper for Mac?
Which one of them properly supports emulation of cmd.exe calls bat scripts?
Should i waste time porting bat to sh or i could use some wine-powered wrappers for everything?
Anyone tried something like this?

I had limited expirience with cinder-like wrappers long ago on mac, wrapped several windows games to make them run on his mac, but there was niether bat files, nor chain of exe>bat>exe>bat calls, also i dont even remember this process quite well. And yet another problem - this time i dont have any access to Mac and need to make everything within windows, blindly or emulated.

Any tips, suggestions, links, automated conversion tools and everything appreciated! Thanks!

foxidrive
Expert
Posts: 6033
Joined: 10 Feb 2012 02:20

Re: Porting Windows Batch (BAT) to Mac OS X shell scripts (S

#2 Post by foxidrive » 21 Jul 2012 03:35

I'd suggest that you learn the native scripting language.

Squashman
Expert
Posts: 3739
Joined: 23 Dec 2011 13:59

Re: Porting Windows Batch (BAT) to Mac OS X shell scripts (S

#3 Post by Squashman » 21 Jul 2012 08:41

You could probably doing some things with bash on OS X but like Foxi said you would probably be better off learning Apple Script.
Last edited by Squashman on 22 Jul 2012 13:40, edited 1 time in total.

Voodooman
Posts: 12
Joined: 25 Sep 2011 07:45

Re: Porting Windows Batch (BAT) to Mac OS X shell scripts (S

#4 Post by Voodooman » 22 Jul 2012 04:16

Im not sure that apple sctipt is what i need.
Apple script is more like Auto Hot key for windows, and less like dos command prompt, while shell scripts are much closer to that and much more powerful.

Squashman
Expert
Posts: 3739
Joined: 23 Dec 2011 13:59

Re: Porting Windows Batch (BAT) to Mac OS X shell scripts (S

#5 Post by Squashman » 22 Jul 2012 13:42

Voodooman wrote:Im not sure that apple sctipt is what i need.
Apple script is more like Auto Hot key for windows, and less like dos command prompt, while shell scripts are much closer to that and much more powerful.

Either way. This is not the correct web forum to discuss BASH or Apple Script. I don't know Apple Script but my friends that do say they can do a lot things with it and consider it to be very powerful. I do know BASH as I was a Linux Admin for a few years and I do like it.

Post Reply