Shells and Processes - Quiz Explanation

The correct answers are indicated below, along with text that explains the correct answers.
 
1. Look at the following ps –f command output.
$ ps -f

     UID   PID  PPID  C    STIME TTY      TIME CMD

 sbarr59  3763  3762  0 00:20:09 pts/1    0:00 /bin/sh

 sbarr59  3762  3750  0 00:20:03 pts/1    0:00 /bin/ksh

 sbarr59  3750  3748  0 00:19:23 pts/1    0:00 /bin/csh
Which shell is the parent process of the Korn shell seen in the listing above?
Please select the best answer.
  A. The Korn Shell
  B. The Bourne shell
  C. The C shell
  D. The bash shell
  C is the correct answer.
because process 3750 is the PPID of the Korn shell’s parent process. This is the PID of the C shell. A and B are incorrect since they do not have a PID of 3750. D is incorrect because there is no bash shell listed in the output.

2. Which one of the following files contains the name of your login shell?
Please select the best answer.
  A. /etc/passwd
  B. /etc/login
  C. /etc/hosts
  D. /etc/profile
  A is the correct answer,
because the /etc/passwd file contains the login information for all accounts on the system, including the login shell for each account. B, C, and D are incorrect because these files all contain information other than login name and shell information.

3. When a shell script begins, it has an initial value for the PATH variable. Where does this value come from?
Please select the best answer.
  A. It’s passed down from the script’s parent shell.
  B. It’s passed up from the script’s child shell.
  C. It’s read by the script from the /etc/profile file.
  D. It’s read by the script from the .profile file.
  A is the correct answer ,
since the PATH is always passed from the parent process down to the shell.
B is incorrect since the script does not necessarily have a child shell. C and D are both incorrect because scripts will not automatically read either of these files.