How does one process we can start an executable file? How to
get the PID process, which we started?

Answer Posted / sangeetha

We can start a new process from an existing process by
calling the function system("new process &"). The & sign
indicates the new process will run in background. Then
after this we can use the "ps" command to get the PID of
the new process.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a command that will find all text files in a directory such that it does not contain the word "amazing" in any form (that is, it must include the words amazing, amazing, or amazing)?

954


How do I open a port?

589


Which command will print your home directory on screen?

542


Which command is used to restrict incoming messages?

592


Why is grep called grep?

777






What is unix command line?

606


What is a bash command?

624


How to use grep command to list find the records of a file containing 10 different strings?

643


Name the various commands that are used for the user information in unix.

539


What does the command '$ls | wc –l > file1' do?

678


When i run a programm of orphan process. Instead of getting child's parent (ppid)=1 ..i get 1400 and it varies as per system. How can i findthe right soluion??? My pgm: #include # include int main() { int pid; pid=fork(); if(pid < 0) {exit(-1);} else if(pid==0) { printf("Child Process is Sleeping ..."); sleep(10); printf("Orphan Child's Parent ID : %u ",getppid()); } else { printf("Parent Process Completed ... %u ",getpid()); exit(0); } return 0; } Output:

1758


What do chgrp command do?

590


Is there any method to erase all files in the current directory, along with its all sub-directories, by using only one command?

589


Which command is used to copy files?

556


What are the unix commands?

557