This is the mail archive of the cygwin@cygwin.com 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]

Problem with program started from bash invoking bash using CreateProcess


Hello,
    I am facing a funny problem with bash-2.05-6 and cygwin-1.3.2-1.
This problem was not there with bash-2.04-3. Please compile the
attached program in MSVC 6.0 and produce the executable. From
a bash shell try the following

$ ./cygtest d:/cygwin/bin/bash.exe
The program displays the following output

d:/cygwin/bin/bash.exe
Process created
When ready press any key to continue
d:/cygwin/bin/bash.exe: d:/cygwin/bin/bash.exe: cannot execute binary file
Process finished

Now try the following
$ ./cygtest d:/cygwin/bin/sh.exe
d:/cygwin/bin/sh.exe
Process created
When ready press any key to continue
MZ???ÿÿ,@???º?': not found
??º?': not found
d:/cygwin/bin/sh.exe: 12: Syntax error: "&" unexpected
Process finished

If the same program is invoked a DOS command shel or Hamilton Cshell,
it works as expected. What is going on here? I came across this
problem while trying sort out a problem with program running
from a bash shell script trying to interpret another shell script  using 
CreateProcess call. The funny thing is that the problem does happen not if 
we use the exec routine.

I am experiencing this problem on NT 4.0 with Servicepack 6.

Thank in Advance,
Afsal
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

cygtest.c

cygcheck.out

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

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