executable won't execute

executable won't execute

Post by Bogdan Udre » Mon, 14 Dec 1998 04:00:00



Hi all.

This is a dumb question to which I couldn't find the answer in any FAQ
or Linux
manual.

I've just setup my RedHat 5.2 and wanted to try out the f77 compiler.
Well, I wrote
a two liner that prints a real. The compiler spits out an a.out with the
right permissions

...
-rwxrwxr-x   1 udrea    udrea       65733 Dec 13 23:02 a.out
...

but linux says that a.out is not found as a command. I've tried it as
root also with the
same result.

Am I missing something fundamental here?

 
 
 

executable won't execute

Post by jason venagli » Tue, 15 Dec 1998 04:00:00



> Hi all.

> This is a dumb question to which I couldn't find the answer in any FAQ
> or Linux
> manual.

> I've just setup my RedHat 5.2 and wanted to try out the f77 compiler.
> Well, I wrote
> a two liner that prints a real. The compiler spits out an a.out with the
> right permissions

> ...
> -rwxrwxr-x   1 udrea    udrea       65733 Dec 13 23:02 a.out
> ...

> but linux says that a.out is not found as a command. I've tried it as
> root also with the
> same result.

> Am I missing something fundamental here?

Did you try ./a.out

Jason

 
 
 

executable won't execute

Post by Josh Rusk » Tue, 15 Dec 1998 04:00:00


the current directory is probably not on your path
either add
PATH=${PATH}:.
to your /etc/profile, ${HOME}/.profile, etc, or type
./a.out

> Hi all.

> This is a dumb question to which I couldn't find the answer in any FAQ
> or Linux
> manual.

> I've just setup my RedHat 5.2 and wanted to try out the f77 compiler.
> Well, I wrote
> a two liner that prints a real. The compiler spits out an a.out with the
> right permissions

> ...
> -rwxrwxr-x   1 udrea    udrea       65733 Dec 13 23:02 a.out
> ...

> but linux says that a.out is not found as a command. I've tried it as
> root also with the
> same result.

> Am I missing something fundamental here?

 
 
 

executable won't execute

Post by Mark Tranchan » Wed, 16 Dec 1998 04:00:00


Try "./a.out". If the current directory is not in the path then you
won't find it. Secondly, try "file a.out" and check it recognizes it as
an ELF binary.

Mark.


> Hi all.

> This is a dumb question to which I couldn't find the answer in any FAQ
> or Linux
> manual.

> I've just setup my RedHat 5.2 and wanted to try out the f77 compiler.
> Well, I wrote
> a two liner that prints a real. The compiler spits out an a.out with the
> right permissions

> ...
> -rwxrwxr-x   1 udrea    udrea       65733 Dec 13 23:02 a.out
> ...

> but linux says that a.out is not found as a command. I've tried it as
> root also with the
> same result.

> Am I missing something fundamental here?

 
 
 

executable won't execute

Post by Peter Flyn » Fri, 18 Dec 1998 04:00:00


[...]

Quote:> but linux says that a.out is not found as a command.
[...]
> Am I missing something fundamental here?

Yep. Unix search paths don't work like DOS, where the current
directory is always searched first and the path only used if
nothing is found. Under most Unix systems, the search path is
the _only_ set of directories searched, and if the current
directory is not in the path, a program in it won't get seen.

Either change your path so it includes "." (symbolic for "here")
or type ./a.out instead of a.out

///Peter
--
DTDs are not common knowledge because programming students are not
taught markup.  A markup language is not a programming language.

 
 
 

executable won't execute

Post by Nathan Hru » Sat, 19 Dec 1998 04:00:00


: [...]
: > but linux says that a.out is not found as a command.
: [...]
: > Am I missing something fundamental here?
:
: Yep. Unix search paths don't work like DOS, where the current
: directory is always searched first and the path only used if
: nothing is found. Under most Unix systems, the search path is
: the _only_ set of directories searched, and if the current
: directory is not in the path, a program in it won't get seen.
:
: Either change your path so it includes "." (symbolic for "here")
: or type ./a.out instead of a.out

Don't add ./ to your path.  It's bad form and a security risk.  Start the
command with ./foo (where foo is the command in the current directory) or
make a directory for you executeables (I suggest 'bin') in your home
directory and add _that_ to your $PATH

:
: ///Peter
: --
: DTDs are not common knowledge because programming students are not
: taught markup.  A markup language is not a programming language.

--
-----------------------------------------------------------------------------
nathan hruby

-----------------------------------------------------------------------------

 
 
 

executable won't execute

Post by Eduardo Pere » Sat, 26 Dec 1998 04:00:00



> Hi all.

> This is a dumb question to which I couldn't find the answer in any FAQ
> or Linux
> manual.

> I've just setup my RedHat 5.2 and wanted to try out the f77 compiler.
> Well, I wrote
> a two liner that prints a real. The compiler spits out an a.out with the
> right permissions

> ...
> -rwxrwxr-x   1 udrea    udrea       65733 Dec 13 23:02 a.out
> ...

> but linux says that a.out is not found as a command. I've tried it as
> root also with the
> same result.

> Am I missing something fundamental here?

Unless you have '.' in your path (and you should not have it), you must
specify to your shell where the file is. Try './a.out'.

I hope this helps.