100% Latest & Updated LPI 102-500 Practice Test Questions, Exam Dumps & Verified Answers!
30 Days Free Updates, Instant Download!
Question 60
A revoked proxy value keeps appearing in newly spawned child processes after an administrator deletes one assignment line. Which THREE case-specific steps cover immediate repair, test evidence and sustained control?
- Audit startup scripts for duplicate environment definitions during decommissioning.
- Use read -r target and validate target before acting on it.
- Unset the variable in the current shell and remove every active startup-file assignment that recreates it.
- Check effective identity during a controlled run and confirm unauthorized users cannot escalate.
- Check env in both the current shell and a fresh login shell to confirm the variable is absent.
- Include filenames with whitespace and glob characters in automated script regression tests.
Explanation
Correct Answers
A:Audit startup scripts for duplicate environment definitions during decommissioning. This control detects or prevents the same mechanism before another incident.
C:Unset the variable in the current shell and remove every active startup-file assignment that recreates it. It addresses the root cause, while Audit startup scripts for duplicate environment definitions during decommissioning. reduces future recurrence.
E:Check env in both the current shell and a fresh login shell to confirm the variable is absent. The test is evidence-based because the underlying failure was: An already exported variable remains in the current process environment until unset or the shell is replaced.
Incorrect Answers
B:The test for read input instead of hardcoding would be: Provide two different test inputs and confirm the selected host changes accordingly. The relevant acceptance check here is: Check env in both the current shell and a fresh login shell to confirm the variable is absent.
D:Linux generally ignores setuid elevation on interpreter scripts because it is unsafe. That describes a different fault. Here, An already exported variable remains in the current process environment until unset or the shell is replaced.
F:Unquoted shell expansions undergo word splitting and pathname expansion after variable substitution. That describes a different fault. Here, An already exported variable remains in the current process environment until unset or the shell is replaced.
Question 61
A script uses Bash-specific [[ tests, but an automation launcher invokes it on a host where /bin/sh is not Bash. Which explanation most directly accounts for the failure in this environment?
- A /bin/sh shebang does not promise Bash extensions and direct execution follows the shebang interpreter.
- New home-directory defaults come from the configured skeleton directory, not an existing user's home.
- A function defined in one shell is not automatically a function in an unrelated child shell.
- Bash's ~/.bash_logout is the per-user login-shell exit hook, while ~/.bashrc is an interactive startup hook.
Explanation
Correct Answer
A:A /bin/sh shebang does not promise Bash extensions and direct execution follows the shebang interpreter. A good follow-up is to test this explanation through: Execute the script directly under the production launcher and verify it runs with Bash semantics.
Incorrect Answers
B:That choice responds to a new account skeleton content failure. In this incident, A /bin/sh shebang does not promise Bash extensions and direct execution follows the shebang interpreter.
C:A function defined in one shell is not automatically a function in an unrelated child shell. could help with function available only in parent; it neither resolves nor demonstrates the current requirement. The distinguishing check is: Execute the script directly under the production launcher and verify it runs with Bash semantics.
D:That choice responds to a login shell cleanup failure. In this incident, A /bin/sh shebang does not promise Bash extensions and direct execution follows the shebang interpreter.
Question 62
A script uses Bash-specific [[ tests, but an automation launcher invokes it on a host where /bin/sh is not Bash. Which intervention addresses the specific problem with the least unrelated change?
- Use ~/.bash_logout for appropriate per-user login-shell cleanup, with guarded path handling.
- Use #!/usr/bin/env bash or an approved absolute Bash path for the Bash-dependent script.
- Place interactive aliases in ~/.bashrc and source that file from a login profile only when needed.
- Unset the variable in the current shell and remove every active startup-file assignment that recreates it.
Explanation
Correct Answer
B:Use #!/usr/bin/env bash or an approved absolute Bash path for the Bash-dependent script. This is appropriate because A /bin/sh shebang does not promise Bash extensions and direct execution follows the shebang interpreter.
Incorrect Answers
A:This belongs to login shell cleanup, where Bash's ~/.bash_logout is the per-user login-shell exit hook, while ~/.bashrc is an interactive startup hook. The current issue instead is: A /bin/sh shebang does not promise Bash extensions and direct execution follows the shebang interpreter.
C:This belongs to nonlogin terminal startup, where Interactive non-login Bash reads ~/.bashrc rather than the login profile by default. The current issue instead is: A /bin/sh shebang does not promise Bash extensions and direct execution follows the shebang interpreter.
D:That choice responds to a startup environment removal failure. In this incident, A /bin/sh shebang does not promise Bash extensions and direct execution follows the shebang interpreter.
Question 63
A script uses Bash-specific [[ tests, but an automation launcher invokes it on a host where /bin/sh is not Bash. Which observation should be used for acceptance testing?
- Execute the script directly under the production launcher and verify it runs with Bash semantics.
- Test fresh login shells for two different accounts and inspect the exported variable.
- Start a fresh bash login shell and inspect PATH after tracing which profile was read.
- Run env in a child shell and verify REPORT_ROOT is included with the expected value.
Explanation
Correct Answer
A:Execute the script directly under the production launcher and verify it runs with Bash semantics. The test is evidence-based because the underlying failure was: A /bin/sh shebang does not promise Bash extensions and direct execution follows the shebang interpreter.
Incorrect Answers
B:The test for shared shell initialization would be: Test fresh login shells for two different accounts and inspect the exported variable. The relevant acceptance check here is: Execute the script directly under the production launcher and verify it runs with Bash semantics.
C:Start a fresh bash login shell and inspect PATH after tracing which profile was read. could help with bash login profile precedence; it neither resolves nor demonstrates the current requirement. The distinguishing check is: Execute the script directly under the production launcher and verify it runs with Bash semantics.
D:Run env in a child shell and verify REPORT_ROOT is included with the expected value. belongs to a situation where A shell-local assignment is not automatically included in the environment inherited by child processes. Here the evidence supports a different requirement: Execute the script directly under the production launcher and verify it runs with Bash semantics.
Question 64
A script uses Bash-specific [[ tests, but an automation launcher invokes it on a host where /bin/sh is not Bash. Which ongoing control would best reduce the chance of the issue returning?
- Use command-scoped environment overrides for reproducible automation and preserve user defaults.
- Declare the required interpreter and avoid assuming every /bin/sh implementation is Bash.
- Document whether helper behavior belongs in a sourced function or a standalone executable.
- Audit whether task variables need to be shell-local or exported to child processes.
Explanation
Correct Answer
B:Declare the required interpreter and avoid assuming every /bin/sh implementation is Bash. Sustained checks matter because A /bin/sh shebang does not promise Bash extensions and direct execution follows the shebang interpreter.
Incorrect Answers
A:Use command-scoped environment overrides for reproducible automation and preserve user defaults. could help with one command environment override; it neither resolves nor demonstrates the current requirement. The distinguishing check is: Execute the script directly under the production launcher and verify it runs with Bash semantics.
C:This option assumes A function defined in one shell is not automatically a function in an unrelated child shell. The reported symptoms instead call for: Use #!/usr/bin/env bash or an approved absolute Bash path for the Bash-dependent script.
D:That choice responds to a child process inherited variable failure. In this incident, A /bin/sh shebang does not promise Bash extensions and direct execution follows the shebang interpreter.
Question 65
A script uses Bash-specific [[ tests, but an automation launcher invokes it on a host where /bin/sh is not Bash. Select TWO justified actions that address this particular problem and confirm closure.
- Version-control skeleton templates and test new-account provisioning rather than mutating active homes.
- Use type -a audit and command -v audit to inspect every candidate and the selected path.
- Execute the script directly under the production launcher and verify it runs with Bash semantics.
- Use #!/usr/bin/env bash or an approved absolute Bash path for the Bash-dependent script.
- Put the approved executable directory before the conflicting directory or invoke its absolute path.
Explanation
Correct Answers
C:Execute the script directly under the production launcher and verify it runs with Bash semantics. The test is evidence-based because the underlying failure was: A /bin/sh shebang does not promise Bash extensions and direct execution follows the shebang interpreter.
D:Use #!/usr/bin/env bash or an approved absolute Bash path for the Bash-dependent script. Unlike a broad workaround, it targets the observed cause: A /bin/sh shebang does not promise Bash extensions and direct execution follows the shebang interpreter.
Incorrect Answers
A:This option assumes New home-directory defaults come from the configured skeleton directory, not an existing user's home. The reported symptoms instead call for: Use #!/usr/bin/env bash or an approved absolute Bash path for the Bash-dependent script.
B:That choice responds to a command lookup path ordering failure. In this incident, A /bin/sh shebang does not promise Bash extensions and direct execution follows the shebang interpreter.
E:Put the approved executable directory before the conflicting directory or invoke its absolute path. belongs to a situation where Command lookup follows the order of directories in PATH, not the newest version of an executable. Here the evidence supports a different requirement: Use #!/usr/bin/env bash or an approved absolute Bash path for the Bash-dependent script.
Question 66
A loop processes reports with names containing spaces, but unquoted variable expansion splits each path into separate arguments. Which diagnosis is supported by the observations?
- A shell-local assignment is not automatically included in the environment inherited by child processes.
- Editing a startup file changes what future shells read; it does not rewrite the running shell's variables.
- Command lookup follows the order of directories in PATH, not the newest version of an executable.
- Unquoted shell expansions undergo word splitting and pathname expansion after variable substitution.
Explanation
Correct Answer
D:Unquoted shell expansions undergo word splitting and pathname expansion after variable substitution. This is the explanation that justifies the specific remedy: Quote "$file" at each use and iterate safely over properly expanded pathnames.
Incorrect Answers
A:This belongs to child process inherited variable, where A shell-local assignment is not automatically included in the environment inherited by child processes. The current issue instead is: Unquoted shell expansions undergo word splitting and pathname expansion after variable substitution.
B:It would address execute profile in current process rather than the present problem. The appropriate correction here is: Quote "$file" at each use and iterate safely over properly expanded pathnames.
C:This option assumes Command lookup follows the order of directories in PATH, not the newest version of an executable. The reported symptoms instead call for: Quote "$file" at each use and iterate safely over properly expanded pathnames.
Question 67
A loop processes reports with names containing spaces, but unquoted variable expansion splits each path into separate arguments. Which configuration approach is appropriate for this requirement?
- Run LANG=C followed by the intended command so the assignment is scoped to that invocation.
- Define the function in an appropriate Bash startup file; for a supported inherited child Bash, export -f can be used deliberately.
- Quote "$file" at each use and iterate safely over properly expanded pathnames.
- Put login-wide settings in /etc/profile or an applicable profile.d snippet, considering the distribution's startup arrangement.
Explanation
Correct Answer
C:Quote "$file" at each use and iterate safely over properly expanded pathnames. It corrects the mechanism identified in the scenario: Unquoted shell expansions undergo word splitting and pathname expansion after variable substitution.
Incorrect Answers
A:This option assumes Exporting LANG globally to the shell would affect subsequent children, not just the single build execution. The reported symptoms instead call for: Quote "$file" at each use and iterate safely over properly expanded pathnames.
B:This option assumes A function defined in one shell is not automatically a function in an unrelated child shell. The reported symptoms instead call for: Quote "$file" at each use and iterate safely over properly expanded pathnames.
D:The test for shared shell initialization would be: Test fresh login shells for two different accounts and inspect the exported variable. The relevant acceptance check here is: Test with a filename containing whitespace and confirm each file is processed once.
Question 68
A loop processes reports with names containing spaces, but unquoted variable expansion splits each path into separate arguments. Which observation should be used for acceptance testing?
- Test with a filename containing whitespace and confirm each file is processed once.
- Open a new ordinary terminal and use type to verify the alias is visible.
- Print LANG in the build subprocess and again afterward in the parent shell.
- Use type -a audit and command -v audit to inspect every candidate and the selected path.
Explanation
Correct Answer
A:Test with a filename containing whitespace and confirm each file is processed once. This measures the specific result of applying: Quote "$file" at each use and iterate safely over properly expanded pathnames.
Incorrect Answers
B:That choice responds to a nonlogin terminal startup failure. In this incident, Unquoted shell expansions undergo word splitting and pathname expansion after variable substitution.
C:This option assumes Exporting LANG globally to the shell would affect subsequent children, not just the single build execution. The reported symptoms instead call for: Quote "$file" at each use and iterate safely over properly expanded pathnames.
D:The test for command lookup path ordering would be: Use type -a audit and command -v audit to inspect every candidate and the selected path. The relevant acceptance check here is: Test with a filename containing whitespace and confirm each file is processed once.
Question 69
A loop processes reports with names containing spaces, but unquoted variable expansion splits each path into separate arguments. Which ongoing control would best reduce the chance of the issue returning?
- Maintain global login configuration centrally rather than copying account-specific dotfiles.
- Include filenames with whitespace and glob characters in automated script regression tests.
- Version-control skeleton templates and test new-account provisioning rather than mutating active homes.
- Make logout hooks idempotent and avoid destructive cleanup on shared directories.
Explanation
Correct Answer
B:Include filenames with whitespace and glob characters in automated script regression tests. The underlying risk is Unquoted shell expansions undergo word splitting and pathname expansion after variable substitution.
Incorrect Answers
A:The test for shared shell initialization would be: Test fresh login shells for two different accounts and inspect the exported variable. The relevant acceptance check here is: Test with a filename containing whitespace and confirm each file is processed once.
C:That choice responds to a new account skeleton content failure. In this incident, Unquoted shell expansions undergo word splitting and pathname expansion after variable substitution.
D:The test for login shell cleanup would be: Exit a test login shell and verify only its intended temporary artifacts are removed. The relevant acceptance check here is: Test with a filename containing whitespace and confirm each file is processed once.
Question 70
A loop processes reports with names containing spaces, but unquoted variable expansion splits each path into separate arguments. Select THREE measures that follow directly from the root cause and lifecycle risk.
- Test with a filename containing whitespace and confirm each file is processed once.
- Include filenames with whitespace and glob characters in automated script regression tests.
- Unset the variable in the current shell and remove every active startup-file assignment that recreates it.
- Audit startup scripts for duplicate environment definitions during decommissioning.
- Quote "$file" at each use and iterate safely over properly expanded pathnames.
- Run env in a child shell and verify REPORT_ROOT is included with the expected value.
Explanation
Correct Answers
A:Test with a filename containing whitespace and confirm each file is processed once. This check is tied to the expected behavior rather than mere process uptime.
B:Include filenames with whitespace and glob characters in automated script regression tests. It makes the outcome of the targeted repair (Quote "$file" at each use and iterate safely over properly expanded pathnames.) repeatable.
E:Quote "$file" at each use and iterate safely over properly expanded pathnames. It is the direct response; verify the result by: Test with a filename containing whitespace and confirm each file is processed once.
Incorrect Answers
C:That choice responds to a startup environment removal failure. In this incident, Unquoted shell expansions undergo word splitting and pathname expansion after variable substitution.
D:This option assumes An already exported variable remains in the current process environment until unset or the shell is replaced. The reported symptoms instead call for: Quote "$file" at each use and iterate safely over properly expanded pathnames.
F:Run env in a child shell and verify REPORT_ROOT is included with the expected value. belongs to a situation where A shell-local assignment is not automatically included in the environment inherited by child processes. Here the evidence supports a different requirement: Test with a filename containing whitespace and confirm each file is processed once.
LPI Level 1 (102-500) Practice Tests