can't execute an executable file.....

can't execute an executable file.....

Post by JJ » Wed, 10 Jan 2001 15:50:22



I installed RedHat Linux 6.2 recently. When compiled and tried to execute a
simple C program, I got the following error - "bash: a.out: command not
found."

I compiled my HelloWorld program using gcc as follows: gcc simple.c (no
erros were reported)
Then, I checked a.out attributes, they were -rwxr-xr-x.

What can be wrong? Why doesn't it execute?

Please, help. TIA :)

 
 
 

can't execute an executable file.....

Post by Tim Watkin » Wed, 10 Jan 2001 14:05:00




> I installed RedHat Linux 6.2 recently. When compiled and tried to
> execute a simple C program, I got the following error - "bash: a.out:
> command not found."

> I compiled my HelloWorld program using gcc as follows: gcc simple.c (no
> erros were reported) Then, I checked a.out attributes, they were
> -rwxr-xr-x.

> What can be wrong? Why doesn't it execute?

> Please, help. TIA :)

Try using the complete path.  If the directory your a.out file is in, is
not in your path, it won't execute it.  Try instead

./a.out

The ./ signifies the current directory.

Tim

 
 
 

can't execute an executable file.....

Post by James Ro » Wed, 10 Jan 2001 16:10:25


Quote:

>What can be wrong? Why doesn't it execute?

Well your error lies in assuming that . (your current directory) is in
your path.  That is where bash and others look for commands.  Type
/a.out and see what happens.
 
 
 

can't execute an executable file.....

Post by Lew Pitch » Wed, 10 Jan 2001 22:40:57




>>What can be wrong? Why doesn't it execute?
>Well your error lies in assuming that . (your current directory) is in
>your path.  That is where bash and others look for commands.  Type
>/a.out and see what happens.

Make that
  ./a.out

Lew Pitcher
Information Technology Consultant
Toronto Dominion Bank Financial Group


(Opinions expressed are my own, not my employer's.)

 
 
 

can't execute an executable file.....

Post by James Ro » Thu, 11 Jan 2001 03:32:13


Quote:>>your path.  That is where bash and others look for commands.  Type
>>/a.out and see what happens.

>Make that
>  ./a.out

Oops.  Yeah that would be what I MEANT to type.
 
 
 

can't execute an executable file.....

Post by Michael V. Ferrant » Fri, 12 Jan 2001 10:00:13



Quote:>What can be wrong? Why doesn't it execute?

        It has to be called explicitly, since it's probably not in your $PATH.
You can do this by prepending "./" to the filename (ie: "./a.out").  It's a
Unix anti-trojan security measure to prevent users from executing jobs that
don't exist in the far more well-protected $PATH directories.

--               Michael V. Ferranti [blades&inreach*com]
Linux Counter Reg.ID# 177869    http://counter.li.org    GNUke The Planet!
Sign The Linux Driver Petition:   www.libralinux.com/petition.english.html

 
 
 

can't execute an executable file.....

Post by FitzDe » Fri, 12 Jan 2001 15:44:50


Quote:>>What can be wrong? Why doesn't it execute?

>    It has to be called explicitly, since it's probably not in your $PATH.
>You can do this by prepending "./" to the filename (ie: "./a.out").  It's a
>Unix anti-trojan security measure to prevent users from executing jobs that
>don't exist in the far more well-protected $PATH directories.

If $PATH doesn't solve it, make sure
the file is truely an executable.  You
may have to do a chmod +x.
 
 
 

1. Can't execute files that are executable

Hi everyone,

Can someone help this Linux newbie?  I can't execute files that should be
executable.  I've written (actually edited) some scripts, then make them
exectable by running "chmod +x filename".  But when I try to run the script
from a command prompt, I get "bash: filename: command not found."

The funny thing is, I can execute these from the Gnome file manager.

Why is this guys?  Thanks for any info.

George

2. VNC port question

3. executable files w/o using 'file'

4. Concurrent C for Linux?

5. SVGA Doom Problem...

6. Executable Binary File vs. Executable Script File

7. Need help writing serial "wakeup" comm routine

8. executable won't execute

9. using popen to execute and feed input to set of executable files

10. How do I write an executable 'batch' file

11. Can't execute binary files and file corruption?

12. It's not bad canned meat...