Question 90
A lab administrator is preparing to fix: An operator must find every user record whose login shell ends with nologin, but a plain substring search matches comments elsewhere. Which proposed operation addresses that specific need?
Explanation
Correct Answer
The change that addresses the reported condition is to match the final shell field with an end-of-line anchor and appropriately escaped text. The host problem is: An operator must find every user record whose login shell ends with nologin, but a plain substring search matches comments elsewhere. The supporting evidence is to review the passwd file's colon-delimited fields and the regular expression used by grep. Check success by verifying that only account lines whose last field names the nologin shell appear. The fix should be persistent where the task requires it.
Incorrect Answers
Use grep with extended regular expressions and anchored or bounded alternatives as warranted. The check concerns grep with extended regular expressions and anchored or bounded alternatives as warranted, not matching the final shell field with an end-of-line anchor and appropriately escaped text.
Use gzip-aware tar extraction for the gzip archive or recreate with the intended format. This assesses gzip-aware tar extraction for the gzip archive or recreate with the intended format; it does not determine the reported condition—an operator must find every user record whose login shell ends with nologin, but a plain substring search matches comments elsewhere.
Use case-insensitive matching for the approved keyword pattern and confirm the expected scope. The case-specific requirement is matching the final shell field with an end-of-line anchor and appropriately escaped text, which that option does not establish.