By Creating child process send the result of command to child process.
main()
{
int pid;
pid=fork();
if ( pid==0)
{
printf(“ exec starts\n”);
execl(“/bin/ls”,”ls”,”-l”,(char*)0);
printf(“ Execl did not work\n”);
}
else
{
wait(0);
printf(“ Parent : ls is completed in child \n”);
}
}
0 Comments