Re: Convert small shell script to batch file

From: Ted Davis (tdavis_at_gearbox.maem.umr.edu)
Date: 10/21/04


Date: Thu, 21 Oct 2004 07:51:31 -0500

On 21 Oct 2004 03:04:13 -0700, uwe.kotyczka@web.de (Uwe Kotyczka)
wrote:

>Hallo,
>
>I have a small shell script which I want to run in a DOS environment.
>IMO the easiest way will be to rewrite it as a batch file.
>
>However my knowledge of msdos syntax is rather poor, I really did not
>succeed doing it myself.
>
>Can anyone please help me to make a batch file out of this shell script?
>
>TIA
>
>#!/bin/sh
>#
>
># remove .tex extension (if any)
>name=`echo $1 | sed 's/\(.*\)\.tex$/\1/'`
>
># if file exists
>if [ -f "$name.tex" ]; then
> /cygdrive/c/<path1>/latex2html.bat "$name.tex"
> # if last command was successful
> if [ $? = '0' ]; then
> "/cygdrive/c/<path2>/Psp.exe" "$name/img1.gif"
> fi
>fi

It would help a lot to know what operating system you need this for:
the presence of cygwin ipliles that it is not real DOS, but is some
version of Win32 - there are drastic differences between the Win9x
series and the NT series. If we knew what <path1> and <path2> were,
and that it was one of hte NT OSs, I think it would become a
one-liner.

It would also help if you described what you want to do: not many
batch gurus understand shell scripts at all.

The most appropriate place to ask batch questions is either
alt.msdos.batch or alt.msdos.batch.nt, depending on what OS you are
using.

T.E.D. (tdavis@gearbox.maem.umr.edu)
SPAM filter: Messages to this address *must* contain "T.E.D."
somewhere in the body or they will be automatically rejected.



Relevant Pages

  • Re: synchronisation between two executable
    ... Why not use a batch file for just putting them in a loop? ... The shell script guarantees the the output filefrom a.out are ... special keyword to ...
    (comp.lang.fortran)
  • Convert small shell script to batch file
    ... I have a small shell script which I want to run in a DOS environment. ... IMO the easiest way will be to rewrite it as a batch file. ...
    (comp.unix.shell)
  • Re: synchronisation between two executable
    ... Why not use a batch file for just putting them in a loop? ... The shell script guarantees the the output filefrom a.out are ... special keyword to ...
    (comp.lang.fortran)
  • Re: synchronisation between two executable
    ... Why not use a batch file for just putting them in a loop? ... except I would call it a shell script rather ... special keyword to ...
    (comp.lang.fortran)
  • Re: Scheduled task does not run
    ... Depends a lot on what the shell script does. ... | can run the batch file interactively. ... | scheduled task still can not start if the user is not ... | logged onto the console. ...
    (microsoft.public.windows.server.general)