Xref: news2.mv.net comp.os.msdos.djgpp:8389 Newsgroups: comp.os.msdos.djgpp From: design AT netcom DOT com (Chris Waters) Subject: Re: executing unix scripts under dos Message-ID: Organization: Design and Delivery References: <50s8th$76i AT lex DOT zippo DOT com> Date: Sat, 7 Sep 1996 23:27:28 GMT Lines: 44 Sender: design AT netcom8 DOT netcom DOT com To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp In article <50s8th$76i AT lex DOT zippo DOT com>, John Saya 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.