delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/08/06:22:46

Date: Tue, 8 Feb 2000 09:32:32 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Sherlock Campbell <scampbell AT mail DOT utexas DOT edu>
cc: djgpp AT delorie DOT com
Subject: Re: shell scripts in DJGPP
In-Reply-To: <389F23E1.F2C3AB13@mail.utexas.edu>
Message-ID: <Pine.SUN.3.91.1000208093202.28790G-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: dj-admin AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019