public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: Error while running a .exe file in bash
@ 2003-09-26  5:44 Kishen Bahudhanam
  2003-09-26  6:21 ` Brian Dessent
  0 siblings, 1 reply; 4+ messages in thread
From: Kishen Bahudhanam @ 2003-09-26  5:44 UTC (permalink / raw)
  To: cygwin

Thanks to everyone who contributed to this issue. The
problem is resolved if I use: ./tx.exe.
I still don't understand the error message though.
If bash is not able to find the program, then filename
completion shouldn't work, isn't it? For example if I
just type:
    >. t
bash completes the file name to tx.exe (this is the
only executable in the current directory starting with
t).

To make it actually run, I need to type:
   >./tx.exe

Thanks again to everyone.

--- Kishen Bahudhanam <galtj67@yahoo.com> wrote:
> I see a couple of messages on this topic, but
> couldn't
> figure out what to do. So sending the question
> again:
> 
> I compiled my code using gcc, and created a .exe
> file.
> However, when I try to execute it, I get the
> following
> error:
> MZ?: command not found.
> However, I can open a 'cmd' window, and run the
> .exe.
> 
> I am under Win2000. Here is the .exe's attributes,
> and
> the output when I run the exe. 
> 
> -rwxr-xr-x    1 jgalt mkpasswd   455026 Sep 25 12:29
> tx.exe*
> /c/Model>. tx.exe
> bash: MZ?: command not found
> 
> Please help...
> 
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product
> search
> http://shopping.yahoo.com
> 


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Error while running a .exe file in bash
  2003-09-26  5:44 Error while running a .exe file in bash Kishen Bahudhanam
@ 2003-09-26  6:21 ` Brian Dessent
  0 siblings, 0 replies; 4+ messages in thread
From: Brian Dessent @ 2003-09-26  6:21 UTC (permalink / raw)
  To: cygwin

Kishen Bahudhanam wrote:
> 
> Thanks to everyone who contributed to this issue. The
> problem is resolved if I use: ./tx.exe.
> I still don't understand the error message though.
> If bash is not able to find the program, then filename
> completion shouldn't work, isn't it? For example if I
> just type:
>     >. t
> bash completes the file name to tx.exe (this is the
> only executable in the current directory starting with
> t).
> 
> To make it actually run, I need to type:
>    >./tx.exe

Typing ". file" at a bash prompt means "read the file and execute the
commands stored within", which means bash will open the file and try to
execute its contents as if you'd typed them at the prompt.  That is NOT
what you want for an .EXE file, it only works for shell scripts.  To run
a normal executable you just give its name and bash runs it.  In the
case of an executable in the current directory, this is normally not in
the path and so you need to specify "./file" to tell bash to look in the
current directory which is ".".  Those are two completely different uses
of "." though.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Error while running a .exe file in bash
  2003-09-25  7:21 Kishen Bahudhanam
@ 2003-09-25  9:21 ` Corinna Vinschen
  0 siblings, 0 replies; 4+ messages in thread
From: Corinna Vinschen @ 2003-09-25  9:21 UTC (permalink / raw)
  To: cygwin

On Thu, Sep 25, 2003 at 12:17:59AM -0700, Kishen Bahudhanam wrote:
> I see a couple of messages on this topic, but couldn't
> figure out what to do. So sending the question again:
> 
> I compiled my code using gcc, and created a .exe file.
> However, when I try to execute it, I get the following
> error:
> MZ?: command not found.
> However, I can open a 'cmd' window, and run the .exe.
> 
> I am under Win2000. Here is the .exe's attributes, and
> the output when I run the exe. 
> 
> -rwxr-xr-x    1 jgalt mkpasswd   455026 Sep 25 12:29
> tx.exe*
> /c/Model>. tx.exe
> bash: MZ?: command not found

Try ./tx.exe

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Error while running a .exe file in bash
@ 2003-09-25  7:21 Kishen Bahudhanam
  2003-09-25  9:21 ` Corinna Vinschen
  0 siblings, 1 reply; 4+ messages in thread
From: Kishen Bahudhanam @ 2003-09-25  7:21 UTC (permalink / raw)
  To: cygwin

I see a couple of messages on this topic, but couldn't
figure out what to do. So sending the question again:

I compiled my code using gcc, and created a .exe file.
However, when I try to execute it, I get the following
error:
MZ?: command not found.
However, I can open a 'cmd' window, and run the .exe.

I am under Win2000. Here is the .exe's attributes, and
the output when I run the exe. 

-rwxr-xr-x    1 jgalt mkpasswd   455026 Sep 25 12:29
tx.exe*
/c/Model>. tx.exe
bash: MZ?: command not found

Please help...

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-09-26  5:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-26  5:44 Error while running a .exe file in bash Kishen Bahudhanam
2003-09-26  6:21 ` Brian Dessent
  -- strict thread matches above, loose matches on Subject: below --
2003-09-25  7:21 Kishen Bahudhanam
2003-09-25  9:21 ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).