Solved

Converting Unix Shell scripts to Windows/Dos Batch files

Posted on 2007-03-22
7
2,142 Views
Last Modified: 2013-12-26
I am inquiring to see if there is a software product or a general way to convert Unix shell scripts to dos batch files. It does not matter if they are done on the fly or manually. All that matters is that the Unix Shell scripts which are running on Unix should be converted to the Dos batch file and give the same results. I have tried to find this on google numerous times but to no avail. If anyone could tell me of a guide or a software I would really appreciate it.

Thank you
0
Comment
Question by:tgatif
7 Comments
 
LVL 58

Expert Comment

by:amit_g
ID: 18775646
http://www.mkssoftware.com/

can be used to run most of those scripts as is in DOS.
0
 
LVL 38

Expert Comment

by:yuzh
ID: 18776198
There is no such tools you can convert a Unix shell script to a DOS patch file.

The best tool is your brain + text editor,  to convert the Unix command to dos systax. You'll find some of the commands  are unconvertable since they are different OS.
0
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 18781466
>> All that matters is that the Unix Shell scripts which are running on Unix should
>> be converted to the Dos batch file and give the same results.

Why not running a UNIX shell on Windows instead of converting the scripts? The options are Cygwin and SfU:

http://www.cygwin.com

http://www.microsoft.com/technet/interopmigration/unix/sfu/default.mspx
0
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

 
LVL 9

Expert Comment

by:mglxxx
ID: 18791292
I'd definitely go with jkr's recommendation. Another way would be to convert everything to perl, because perl is
also available on MS platforms. The conversion would be a one-time manual task. After that, all scripts which apply
both to MS and to Unix should be written in Perl.
0
 
LVL 24

Expert Comment

by:fridom
ID: 18807194
Well I'd go for jkr soluton also. Howrver mglxxx has good arguments also, why he just mentions Perl for that is his secret I guess ;-)

Just let's see what other candidates are around:
Python: www.python.org
Ruby: www.ruby-lang.org
Tcl/Tk:
Schemes
Common Lisps
Smalltalks
Erlang
Haskell
Ocaml
ML
Icon
Rexx
awk
IO
and tons of others.

Scripting language are not just good on Unices ;-)

Regards
Friedrich
0
 
LVL 9

Expert Comment

by:mglxxx
ID: 18809879
Friedrich, of course there are tons of scripting languages available for Windows. However, since we are talking about shell scripts, I assumed that tgatif has a Unix background. Thus  I thought that it would be quite likely that he also knows Perl, which would make
porting the stuff to Windows rather painless.
0
 
LVL 24

Expert Comment

by:fridom
ID: 18813919
Quit an assumption. I'm using Unix all-day but I do not use any Perl, so am I know a Unix user ;-)

Regards
Friedrich
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

If like me you are one who spends a lot of time working and scripting with cmd.exe, sometimes it is handy to be able to quickly view a calendar for a given month and year. This script will quickly do just that!  Save the code posted below to a .bat …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

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

12 Experts available now in Live!

Get 1:1 Help Now