Solved

Converting Unix Shell scripts to Windows/Dos Batch files

Posted on 2007-03-22
7
2,156 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to run a batch process 16 43
Scraping specific data within an XML document 19 53
xcopy loop 13 37
Copy dir and files with robocopy 2 30
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 …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

932 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

15 Experts available now in Live!

Get 1:1 Help Now