This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: bash/sh program interpreter problems...

Robert Schmidt schrieb:
I have the following two programs in /usr/local/bin:

--- test.btm
echo hello from test.btm

naming a shell script .btm is not a good idea, since .btm files are usually 4NT batch files.
same for .h files.
windows has some internal registry key which extensions are executable.

echo hello from test interpreter.  the file is "$1"

--- test.h

chmod +x /usr/local/bin/test.btm chmod +x /usr/local/bin/test.h

does the explicit path help?

--- test.h

One should not assume that test.btm is executable.
BTW: I have the same problems, with some php or java wrappers. The first call gives this error message "bad interpreter", the seconds works fine then.

Then I do this:

~ $ echo $PATH

~ $ test.btm
: bad interpreter: No such file or directoryn/
~ $

First of all, the output is messed up by an ASCII 13 character. Putting an extra space after "" in test.btm fixes this. I don't understand why this problem doesn't occur for /bin/sh or /bin/bash interpreter specifications.

~ $ test.btm
bash: /usr/local/bin/test.btm: /usr/local/bin/ bad interpreter: No such file or directory

Second, I can't figure out why is not found. Further testing shows that the result is highly dependent on the current working directory, and almost inexplicably random. seems to fail much more often then simply test.btm.
The scripts were initially DOS ASCII. Converting them with dos2unix only takes away the first problem above. All mounts are binmode.
Here are a few more runs:

~ $ cd /usr/local/bin
/usr/local/bin $ test.btm
hello from test interpreter. the file is /usr/local/bin/test.btm
/usr/local/bin $
/usr/local/bin/ /usr/local/bin/test.btm: /usr/local/bin/ bad interpreter: No such
file or directory
/usr/local/bin $ test.btm
Reini Urban

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]