8.2k views
1 vote
A user issues the following command sequence: $ & $ bash $ & If the user kills the bash process, then which of the following is true?

1) the second process is also terminated
2) the second process becomes a defunct process
3) the first process becomes a zombie process
4) cannot be fixed

User Zvjezdan
by
7.7k points

1 Answer

0 votes

Final Answer:

If the user kills the bash process after the command sequence "$ & $ bash $ &", the second process becomes a defunct process (option 2).

Step-by-step explanation:

In the given command sequence, the symbols "$ &" are used for job control in Unix-like operating systems. The command "$ &" sends a process to the background, allowing the user to continue working in the same terminal. When the user runs the command "$ bash $ &", they are starting a new Bash shell process in the background.

If the user kills the Bash process (by using a command like "kill" or terminating the terminal session), the background process (second process) becomes a defunct or zombie process. This occurs because the parent process (Bash shell) has terminated, and the child process (the process started in the background) has not yet been reaped by its parent. The defunct process will remain in the system's process table until the system cleans it up.

User Krokodil
by
7.9k points