7 Jan
2006
7 Jan
'06
05:30
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