execl()
replaces the current process (which is your program) with the program passed to execl(). In your case /bin/csh.
So after execl() your program does not run anymore, because it was replaced by /bin/csh. So the printf() line is never reached.
To solve this, use system() instead, with start a
new process, then waits for it to exit, return to your program. Using system(), the program is even simpler:
Code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
system("/bin/csh -c ./coba");
printf("succes\n");
return 0;
}
Note that:
#include <unistd.h> is replaced by
#include <stdlib.h>