Mail Archives: djgpp/1996/09/07/20:51:26
In article <50s8th$76i AT lex DOT zippo DOT com>, John Saya <jsaya AT erc DOT cat DOT syr DOT edu> wrote:
>I have gcc compiled for dos, but am wondering how I can run the
>scripts that come with most of the unix programs out there.
Word of warning: make sure you *really* want to! Most *NIX scripts make
a *lot* of assumptions about the system they're running on--assumptions
which won't apply under DOS.
That said, I've had a lot of success using the MKS toolkit (commercial
port of the *NIX shell and basic tools), and reasonable success using
Iain Stewartson's free super-bourne shell and the gnuish tools (usually
found near whereever DJGPP is stored). One thing to keep in mind is
that *NIX scripts often make assumptions about where things are stored
(e.g. /bin/cat, /usr/bin/touch). One of the first things I do is look
for a PATH statement at the top of a script, and edit that if needed.
However, one thing I have learned from painful experience is to NEVER
run a *NIX script unless you have read and understood it completely.
Too many invalid assumptions about your system can end up trashing
important things.
My success rate with *NIX scripts in general is about 70-80% (higher
than most people probably), but with software configuration scripts in
particular (which is probably what you're concerned with), it is much
lower! Maybe 20-30% after heavy reading/editing.
Another thing that will cause you major headaches: running scripts from
compiled C programs. One of my biggest complaints about DJGPP is that
the system() command is always trying to second-guess me about how
something should be executed. I have a very UNIX-like command-line
environment, but DJGPP tries to avoid using my command line, which I
hate. (I also hate that it doesn't recognize 4DOS's .btm files or
``executable extensions'' too. This makes its second-guessing all but
useless to me.)
>is there something out there that will [...] maybe turn
>them into .bat files?
Dream on! This is about as likely as a program which turns C code into
..bat files, and for the same reason: .bat files are not able to do 90%
of the things that a typical *NIX script can and does do. The default
DOS shell (COMMAND.COM) is an all but useless piece of clutter on your
hard drive. At the very least, I recommend getting 4DOS or Iain
Stewartson's shell, and better yet both.
- Raw text -