Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Question #6 Lnux processes and Process administration Unix identifies every proc

ID: 3602470 • Letter: Q

Question

Question #6 Lnux processes and Process administration Unix identifies every process by a Process Identification Number (pid) which is assigned when 8. the process is created. When we want to perform an operation on a process, we referto it by its pid or Processicd A. True False In a /bin/bash script, what string identifies the "current PID"? If the process/PID is a memory hog and you wantto terminate it, what command do you issue? What user can issue the command in the above question? (Hint: There are two or more, identify at least two) Question #7. /bin/bash exit codes Question Shell exit codes are numeric. How many exit codes are there and what is their numerical range? Answer What is standard exit code for SUCCESS? Task Automation Fall 2017

Explanation / Answer

6.

7.

1 - Catchall for general errors
2 - Misuse of shell builtins (according to Bash documentation)
126 - Command invoked cannot execute
127 - “command not found”
128 - Invalid argument to exit
128+n - Fatal error signal “n”
130 - Script terminated by Control-C
255* - Exit status out of range

2. A successful command returns a 0, while an unsuccessful one returns a non-zero value that usually can be interpreted as an error code. Well-behaved UNIX commands, programs, and utilities return a 0 exit code upon successful completion, though there are some exceptions.