0

This is my source file, base.c ...

#include "/usr/include/stdio.h"
int main( int   argc, char *argv[] )
{
    sprintf("%s\n", "woohoo");
    return(0);
}

I compile and execute with ...

jim@Pappy:~$ gcc base.c
jim@Pappy:~$ a.out
a.out: command not found
jim@Pappy:~$ ll a.out
-rwxrwxr-x 1 jim jim 7255 Jan 15 14:21 a.out*

So why is a.out not found?

1 Answers1

1

The executable is not found because the directory it is in is not on your executable search path $PATH.To run it directly, you need to prepend either a relative path

./a.out

or an absolute path

/home/jim/a.out
steeldriver
  • 142,475