[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mingw-msys
Subject:    Re: [Mingw-msys] Running scripts from MSYS
From:       Keith MARSHALL <keith.marshall () total ! com>
Date:       2005-12-05 15:23:47
Message-ID: OFA28433F7.913E7691-ON802570CE.00533C45-802570CE.00549364 () total ! com
[Download RAW message or body]

Marcus Jacobs wrote:
> I am trying to run a makescript toport some UNIX/Linux programs
> to Windows.  I am having trouble with running the makefile (or
> any script for that matter). For some reason when I go to the
> directory where the makefile is located through the msys shell,
> I get the following error message:
>
>  sh: ./makeall: No such file or directory

This is symptomatic of a script with a shebang line saying

  #! /bin/bash

but MSYS distributes bash as `/bin/sh'.  Change your shebang to

  #! /bin/sh

and I think all will be well.

BTW, unless you specifically require your script to exploit some
feature which is unique to bash, it is bad practice to insert a
shebang which requires bash;  always write your shell scripts to
use the most basic Bourne shell syntax possible, and always make
the shebang say `#! /bin/sh'.

> I have run this script in many different shell environments and I
> know they all act differently. If I run it in BASH shell in Cygwin
> or Linux, if I cd to the directory where the makefile is located
> all I have to do is type
> 
>  "makeall"

If this is sufficient on your Linux box, then you have "." somewhere
in your PATH;  this is a security hole!

> which is the name of the makefile, and the script runs.  From
> Interix I do the same thing except I type "./makeall" and the script
> is recognized and will run.  Here, it seems that no matter what I do
> this particular script is not recognized.  I have properly mounted
> the directory.  I am completely stuck.  Can someone help me?

I think fixing the shebang will solve your problem;  if not, post the
script, so we can see what you might be doing wrong.

BTW, this is an unusual way to run make; most people call their
makefiles `Makefile', then just cd to the appropriate directory, and
type `make',  (or `make target', for any target which isn't the
default.

HTH.

Regards,
Keith.



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Mingw-msys mailing list
Mingw-msys@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-msys
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic