Converting unix shell scripts to dos batch files

  • Follow


Anyone know of a tool or site that converts unix (bourne) shell scripts 
to dos batch files (for NT/2000/XP)?

Thanks,

--Nikolaos

0
Reply nikolaos (3) 7/10/2003 12:00:08 AM

phn@icke-reklam.ipsec.nu wrote:
> Nikolaos Giannopoulos <nikolaos@solmar.ca> wrote:
>> Anyone know of a tool or site that converts unix (bourne) shell scripts 
>> to dos batch files (for NT/2000/XP)?

> www.freebsd.org or www.redhat.org

> Both the above ( and others) will convert a nt2000 machione to one
> capable of interpretinmg bourne shell scripts.

He, I was going to say that...
;)

> Antother possibility is cygnus.

AFAIR "cygwin", but I wouldn't waste my time with it, option 1 is for sure 
the easier way.

-- 
Michael Heiming

Remove +SIGNS and www. if you expect an answer, sorry for 
inconvenience, but I get tons of SPAM
0
Reply Michael 7/10/2003 12:24:01 PM


Nikolaos Giannopoulos wrote:
> Anyone know of a tool or site that converts unix (bourne) shell scripts 
> to dos batch files (for NT/2000/XP)?
> 
> Thanks,
> 
> --Nikolaos
> 

Do you really want DOS or do you want something that will run in the 
native NT/2K/XP shell?  They are not the same thing.  I'll assume the 
latter.  If such a thing exists it would be from a Winders centric 
source.  So you might try asking in ms-windows centric forums about 
such a tool.  Which you may have already done.

The best solution I know of is to install a pseudo-UNIX environment on 
the Winders box.  One that may be able to interpret the script as is. 
The script may well need to be tweaked but not completely re-written.

Two free options are U/Win from 
http://www.research.att.com/sw/tools/uwin/.  It comes with ksh, sh and 
tcsh.  I use it for scripting on my Win2k box at work.  The other is 
cygwin from cygwin.com.  It has a similar capability.

These packages come with core UNIX commandline programs ported to 
Winders.  So if you script uses 'cp' they provide a 'cp' that will do 
what the script expects.  No need to map cp calls to copy calls.

There are also commercial solutions from folks like mks.com and 
microsoft.com.

-- ced


-- 
Chuck Dillon
Senior Software Engineer
NimbleGen Systems Inc.

0
Reply Chuck 7/10/2003 2:15:48 PM

Chuck Dillon wrote:
> Nikolaos Giannopoulos wrote:
> 
  > Do you really want DOS or do you want something that will run in the
> native NT/2K/XP shell?  They are not the same thing.  I'll assume the 

What I want is a tool that would take a first cut at reading in a shell 
script and producing a dos batch file equivalent - I don't mind cleaning 
it up thereafter.

We have a Java app that makes calls to shell scripts for 
pre/post-installation of our product on Solaris and Linux.

We need to have DOS batch file equivalents for our NT/2000/XP installs.

Unfortunately we don't control the target box so we can't use 
interpreters (nor would we want to as they are only required for 
installation).


> latter.  If such a thing exists it would be from a Winders centric 
> source.  So you might try asking in ms-windows centric forums about such 
> a tool.  Which you may have already done.

I have asked in c.o.msdos.programmer and I'm hearing its impossible 
though our shell scripts do not use really advanced commands.

I have also come accross this:
http://www.tldp.org/LDP/abs/html/dosbatch.html

And for a Dos to Unix script check out:
http://garbo.uwasa.fi/pc/batchutil.html
Specifically: batcsh10.zip  28440 Jan 12 1994
Convert MS-DOS batches to Unix csh scripts, fw, B.Pierpoint

Which gives some hope so I guess I'll keep looking.  Thanks.

--Nikolaos

0
Reply Nikolaos 7/11/2003 4:36:27 PM

phn@icke-reklam.ipsec.nu wrote:
> 
> www.freebsd.org or www.redhat.org
> 
> Both the above ( and others) will convert a nt2000 machione to one
> capable of interpretinmg bourne shell scripts.

Interpreters won't unfortunately work as I replied in another post on 
this thread ;-)  Thanks for the idea though.

> 
> Antother possibility is cygnus.
> 
> Otherwize the wintendo/dos shells are hoplessly incapable, there is no way
> of "emulating" the functionality of bourne-scripts on doscmd.

It depends what one requires I guess - I'm not looking for the full 
breadth of shell commands.

Thanks,

--Nikolaos

0
Reply Nikolaos 7/11/2003 4:37:47 PM

Nikolaos Giannopoulos <nikolaos@solmar.ca> wrote:

>What I want is a tool that would take a first cut at reading in a shell 
>script and producing a dos batch file equivalent - I don't mind cleaning 
>it up thereafter.

IMHO the WinNT/WinXP batch language is so far inferior to *any* *NIX
shell scripting language that there's just no way to do it. Again
IHMO, you'd be far better off trying to run the *NIX shell scripts
using Cygwin or U/Win as Chuck Dillon suggested.

--
Tim Slattery
Slattery_T@bls.gov
0
Reply Tim 7/11/2003 4:43:17 PM

On Thu, 10 Jul 2003 at 00:00 GMT, Nikolaos Giannopoulos wrote:
> Anyone know of a tool or site that converts unix (bourne) shell scripts 
> to dos batch files (for NT/2000/XP)?

   That's like asking for something to convert CDs to play on your
   1950's HiFi.

   Short of installing a UNIX shell on the Windows box, the best
   alternative is to convert the script to C (I remember seeing tools
   to do that) and compiling it for Windows.

-- 
    Chris F.A. Johnson                        http://cfaj.freeshell.org
    ===================================================================
    My code (if any) in this post is copyright 2003, Chris F.A. Johnson
    and may be copied under the terms of the GNU General Public License
0
Reply Chris 7/11/2003 5:38:25 PM

6 Replies
306 Views

(page loaded in 0.081 seconds)

Similiar Articles:













7/25/2012 6:41:48 PM


Reply: