Re: Convert small shell script to batch file
From: Ted Davis (tdavis_at_gearbox.maem.umr.edu)
Date: 10/21/04
- Next message: Stephane CHAZELAS: "Re: more gets aborted in the middle"
- Previous message: Skeleton Man: "Re: Convert small shell script to batch file"
- In reply to: Uwe Kotyczka: "Convert small shell script to batch file"
- Next in thread: Dana French: "Re: Convert small shell script to batch file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
- Next message: Stephane CHAZELAS: "Re: more gets aborted in the middle"
- Previous message: Skeleton Man: "Re: Convert small shell script to batch file"
- In reply to: Uwe Kotyczka: "Convert small shell script to batch file"
- Next in thread: Dana French: "Re: Convert small shell script to batch file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|