Solved

Converting Unix Shell scripts to Windows/Dos Batch files

Posted on 2007-03-22
7
2,185 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
The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
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 …
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.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

830 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