Mail Archives: djgpp/2000/02/08/06:22:46
On Mon, 7 Feb 2000, Sherlock Campbell wrote:
> So far, I have been able to compile it using DJGPP but I cannot
> get the shell scripts to run. They all begin with '#!/bin/sh' and
> bash.exe and sh.exe are in my PATH statements. If I run 'sh', then the
> scripts are available, but from my regular DOS prompt it reads 'bad
> command or file name' when I try to run the scripts.
COMMAND.COM cannot run shell scripts. You need to run them like this:
sh script
or
sh ./script
Then it will work. You could also create a batch file for each
script FOO, called FOO.bat, which would say this:
@echo off
sh %0
However, there's a caveat: you cannot redirect standard streams of a
batch file, so if you go this way, you lose the ability to redirect
the script's I/O, which might be important for some scripts.
Note that you don't need all this tyrickery when the script is run by
a DJGPP program, like by Make reading the Makefile, because the DJGPP
library knows about shell scripts and will automatically invoke the
shell, as if you prepended "sh". But COMMAND.COM is not a DJGPP
program...
- Raw text -