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

From: Hans-Bernhard Broeker <broeker AT acp3bf DOT physik DOT rwth-aachen DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: shell scripts in DJGPP
Date: 8 Feb 2000 11:37:33 GMT
Organization: Aachen University of Technology (RWTH)
Lines: 35
Message-ID: <87ov5t$k4d$1@nets3.rz.RWTH-Aachen.DE>
References: <389F23E1 DOT F2C3AB13 AT mail DOT utexas DOT edu>
NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 950009853 20621 137.226.32.75 (8 Feb 2000 11:37:33 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 8 Feb 2000 11:37:33 GMT
User-Agent: tin/1.4-19991113 ("No Labels") (UNIX) (Linux/2.0.0 (i586))
Originator: broeker@
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Sherlock Campbell <scampbell AT mail DOT utexas DOT edu> wrote:
> I am new to DJGPP (and Unix, for that matter) and have run into a
> problem.
> I have a c program that I need to compile and run on a Win98 desktop.
> It is a fairly complex program with several makefiles and lots of
> executables.  I set it up and compiled it successfully on a Solaris Unix
> system.  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.

Exactly. 'command.com' and/or DOS know nothing about the #! method of
specifying that a given file is a script for some specified utility.
So you cannot expect shell scripts to be directly executable, from
command.com.

Remedies:

1) Use 'bash' as your shell (at least for the time of working with that
   package the shell scripts belong to)

2) Start them with an explicit call of 'sh', like

	sh /path/to/script arguments...

or, if they're on the PATH:

	sh -c script arguments...



-- 
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


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