Compiled a C program, cannot run by name
I compiled a C program, but could not execute it using exec filename but only using exec ./filename Can I know why this is so? Thanks. -- Penguin #395953 resides at http://samvit.org subsisting on SUSE Linux 10.0 with KDE 3.5
On Saturday 07 January 2006 06:26, Shriramana Sharma wrote:
I compiled a C program, but could not execute it using
exec filename
but only using
exec ./filename
Can I know why this is so? Thanks.
Program names that doesn't include the path to the file are looked for in the directories listed in the environment variable $PATH. You do not have the directory where the program is in the $PATH variable Also, you don't need to use "exec" as a command to execute programs. Just ./filename will work, and you will still have a shell when it exits
Because "." isn't on your PATH, perhaps?
Did you really want to exec the program, or simply execute it?
Cheers,
Simon
--- Shriramana Sharma
I compiled a C program, but could not execute it using
exec filename
but only using
exec ./filename
Can I know why this is so? Thanks.
--
Penguin #395953 resides at http://samvit.org subsisting on SUSE Linux 10.0 with KDE 3.5
-- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
"You can tell whether a man is clever by his answers. You can tell whether a man is wise by his questions." Naguib Mahfouz __________________________________________ Yahoo! DSL Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com
On Sat, 2006-01-07 at 10:56 +0530, Shriramana Sharma wrote:
I compiled a C program, but could not execute it using
exec filename
but only using
exec ./filename
Can I know why this is so? Thanks.
Is the execute attribute set on the file?
On Saturday, January 07, 2006 @ 5:27 AM, Mike McMullin wrote:
On Sat, 2006-01-07 at 10:56 +0530, Shriramana Sharma wrote:
I compiled a C program, but could not execute it using
exec filename
but only using
exec ./filename
Can I know why this is so? Thanks.
Is the execute attribute set on the file?
And is the path to the file defined in your PATH variable (echo $PATH). Greg Wallace
participants (5)
-
Anders Johansson
-
Greg Wallace
-
Mike McMullin
-
Shriramana Sharma
-
Simon Roberts