LPI 102-500 Practice Test 5
Question 40
A team maintaining a Linux host reports: An operator modifies a single existing user's home files expecting those edits to appear automatically in all future accounts. Which TWO complementary steps provide the best corrective action and its most direct diagnostic verification? Select TWO answers.
- Set a correct interpreter line such as #!/usr/bin/env bash where appropriate and grant execute permission only to intended users while preserving safe file ownership.
- Maintain approved default dotfiles and directory templates under /etc/skel and use the appropriate account-creation option to populate new home directories.
- Edit the current administrator's ~/.bashrc and assume the account-creation utility automatically copies that live home directory to every new user.
- Inspect /etc/skel permissions and contents, review useradd home-creation settings, then create a controlled test account and compare its new home.
- Check the shell invocation mode, inspect /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile and ~/.bashrc, and compare command resolution in fresh login and non-login sessions.
Explanation
Correct Answers
B:Recommended administrative action: Maintain approved default dotfiles and directory templates under /etc/skel and use the appropriate account-creation option to populate new home directories. Linux principle: The skeleton directory provides initial content when a home directory is created; changing an existing user's home does not update the account template or existing users automatically.
D:Most direct verification evidence: Inspect /etc/skel permissions and contents, review useradd home-creation settings, then create a controlled test account and compare its new home. Linux principle: The skeleton directory provides initial content when a home directory is created; changing an existing user's home does not update the account template or existing users automatically.
Incorrect Answers
A:That option would set a correct interpreter line such as #!/usr/bin/env bash where appropriate and grant execute permission only to intended users while preserving safe file ownership, but it addresses a different concern. The skeleton directory provides initial content when a home directory is created; changing an existing user's home does not update the account template or existing users automatically.
C:This shortcut is unsafe for the present Linux issue: Edit the current administrator's ~/.bashrc and assume the account-creation utility automatically copies that live home directory to every new user. The skeleton directory provides initial content when a home directory is created; changing an existing user's home does not update the account template or existing users automatically.
E:That option would check the shell invocation mode, inspect /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile and ~/.bashrc, and compare command resolution in fresh login and non-login sessions, but it addresses a different concern. The skeleton directory provides initial content when a home directory is created; changing an existing user's home does not update the account template or existing users automatically.
Question 41
While verifying a Linux change request, an engineer finds: A maintenance tool runs a setup file in a child process, but its exported functions and PATH changes vanish when control returns to the operator's shell. Which administrative step is the MOST appropriate way to resolve this issue? Select ONE best answer.
- Expect executing ./setup.sh to modify its parent shell and treat VAR='' as identical to completely unsetting VAR.
- Use source or the dot command to evaluate trusted configuration in the current shell, and use unset to remove the variable or function definition when required.
- Define and export or source an appropriate Bash function when reusable parameterized behavior is needed; use aliases for simple interactive substitutions and verify command lookup.
- Use IFS= read -r within an appropriately redirected loop to preserve literal input and design variable state without relying on a pipeline subshell.
Explanation
Correct Answer
B:Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed. Compare shell variables before and after sourcing, inspect the variable with parameter expansion or env, and confirm unset changes definedness as intended.
Incorrect Answers
A:This shortcut is unsafe for the present Linux issue: Expect executing ./setup.sh to modify its parent shell and treat VAR='' as identical to completely unsetting VAR. It cannot establish a safe correction. Linux principle: Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed. Appropriate response: Use source or the dot command to evaluate trusted configuration in the current shell, and use unset to remove the variable or function definition when required. Root-cause evidence: Compare shell variables before and after sourcing, inspect the variable with parameter expansion or env, and confirm unset changes definedness as intended. Independent acceptance: Required settings persist in the invoking shell and decommissioned variables no longer remain defined or exported into new children.
C:That option would define and export or source an appropriate Bash function when reusable parameterized behavior is needed; use aliases for simple interactive substitutions and verify command lookup, but it addresses a different concern. Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed.
D:That option would use IFS= read -r within an appropriately redirected loop to preserve literal input and design variable state without relying on a pipeline subshell, but it addresses a different concern. Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed.
Question 42
A Linux administrator investigates the following system incident: A maintenance tool runs a setup file in a child process, but its exported functions and PATH changes vanish when control returns to the operator's shell. Which Linux behavior or technical principle BEST explains why the issue occurs? Select ONE best answer.
- Expect executing ./setup.sh to modify its parent shell and treat VAR='' as identical to completely unsetting VAR.
- In Bourne-style shells an exit status of zero signals success, while && and || short-circuit on the preceding command-list status rather than on an unrelated later line.
- read -r avoids backslash escape processing, an empty IFS can preserve leading and trailing whitespace, and shell pipeline subshells may isolate assignments.
- Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed.
Explanation
Correct Answer
D:Relevant Linux operating principle: Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed.
Incorrect Answers
A:This shortcut is unsafe for the present Linux issue: Expect executing ./setup.sh to modify its parent shell and treat VAR='' as identical to completely unsetting VAR. Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed.
B:This alternative addresses Shell exit status and AND OR command lists, not the specific issue of Sourcing shell settings and removing variables: In Bourne-style shells an exit status of zero signals success, while && and || short-circuit on the preceding command-list status rather than on an unrelated later line. Linux principle: Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed. Appropriate response: Use source or the dot command to evaluate trusted configuration in the current shell, and use unset to remove the variable or function definition when required. Root-cause evidence: Compare shell variables before and after sourcing, inspect the variable with parameter expansion or env, and confirm unset changes definedness as intended. Independent acceptance: Required settings persist in the invoking shell and decommissioned variables no longer remain defined or exported into new children.
C:This alternative addresses Reading input line by line and preserving backslashes, not the specific issue of Sourcing shell settings and removing variables: read -r avoids backslash escape processing, an empty IFS can preserve leading and trailing whitespace, and shell pipeline subshells may isolate assignments. Linux principle: Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed. Appropriate response: Use source or the dot command to evaluate trusted configuration in the current shell, and use unset to remove the variable or function definition when required. Root-cause evidence: Compare shell variables before and after sourcing, inspect the variable with parameter expansion or env, and confirm unset changes definedness as intended. Independent acceptance: Required settings persist in the invoking shell and decommissioned variables no longer remain defined or exported into new children.
Question 43
On a production Linux workstation or server, a technician observes: A maintenance tool runs a setup file in a child process, but its exported functions and PATH changes vanish when control returns to the operator's shell. Which evidence or command result MOST directly tests the suspected root cause? Select ONE best answer.
- Compare shell variables before and after sourcing, inspect the variable with parameter expansion or env, and confirm unset changes definedness as intended.
- Expect executing ./setup.sh to modify its parent shell and treat VAR='' as identical to completely unsetting VAR.
- Check substitution output, command return status, test expression operands and both empty and positive numeric cases.
- Inspect /etc/skel permissions and contents, review useradd home-creation settings, then create a controlled test account and compare its new home.
Explanation
Correct Answer
A:Most direct verification evidence: Compare shell variables before and after sourcing, inspect the variable with parameter expansion or env, and confirm unset changes definedness as intended.
Incorrect Answers
B:This shortcut is unsafe for the present Linux issue: Expect executing ./setup.sh to modify its parent shell and treat VAR='' as identical to completely unsetting VAR. It cannot establish a safe correction.
C:That option would check substitution output, command return status, test expression operands and both empty and positive numeric cases, but it addresses a different concern. Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed.
D:That option would inspect /etc/skel permissions and contents, review useradd home-creation settings, then create a controlled test account and compare its new home, but it addresses a different concern. Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed.
Question 44
During an LPIC-1 practice lab, the operator encounters this condition: A maintenance tool runs a setup file in a child process, but its exported functions and PATH changes vanish when control returns to the operator's shell. Which observed outcome BEST confirms a successful and properly scoped correction? Select ONE best answer.
- The file runs under its specified interpreter for authorized users and fails safely for unauthorized execution without relying on a misidentified shell.
- Fresh shells of each intended type obtain the expected settings without introducing duplicate PATH entries or leaking secrets.
- Expect executing ./setup.sh to modify its parent shell and treat VAR='' as identical to completely unsetting VAR.
- Required settings persist in the invoking shell and decommissioned variables no longer remain defined or exported into new children.
Explanation
Correct Answer
D:Observable acceptance criterion: Required settings persist in the invoking shell and decommissioned variables no longer remain defined or exported into new children.
Incorrect Answers
A:This alternative addresses Bash shebang and executable permission, not the specific issue of Sourcing shell settings and removing variables: The file runs under its specified interpreter for authorized users and fails safely for unauthorized execution without relying on a misidentified shell. Linux principle: Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed. Appropriate response: Use source or the dot command to evaluate trusted configuration in the current shell, and use unset to remove the variable or function definition when required. Root-cause evidence: Compare shell variables before and after sourcing, inspect the variable with parameter expansion or env, and confirm unset changes definedness as intended. Independent acceptance: Required settings persist in the invoking shell and decommissioned variables no longer remain defined or exported into new children.
B:This alternative addresses Bash login and interactive startup files, not the specific issue of Sourcing shell settings and removing variables: Fresh shells of each intended type obtain the expected settings without introducing duplicate PATH entries or leaking secrets. Linux principle: Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed. Appropriate response: Use source or the dot command to evaluate trusted configuration in the current shell, and use unset to remove the variable or function definition when required. Root-cause evidence: Compare shell variables before and after sourcing, inspect the variable with parameter expansion or env, and confirm unset changes definedness as intended. Independent acceptance: Required settings persist in the invoking shell and decommissioned variables no longer remain defined or exported into new children.
C:This shortcut is unsafe for the present Linux issue: Expect executing ./setup.sh to modify its parent shell and treat VAR='' as identical to completely unsetting VAR. It cannot establish a safe correction. Linux principle: Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed.
Question 45
A helpdesk escalation describes this Linux behavior: A maintenance tool runs a setup file in a child process, but its exported functions and PATH changes vanish when control returns to the operator's shell. Which misleading assumption MOST directly contributes to this failure and should be rejected? Select ONE best answer.
- Expect executing ./setup.sh to modify its parent shell and treat VAR='' as identical to completely unsetting VAR.
- Edit the current administrator's ~/.bashrc and assume the account-creation utility automatically copies that live home directory to every new user.
- Assume every script ending in .sh is run by Bash automatically and that readable script files are always executable using ./script.sh.
- Parse `ls` output with shell word splitting and remove files using unquoted variables because filenames never contain special characters.
Explanation
Correct Answer
A:Reject this specific misconception: Expect executing ./setup.sh to modify its parent shell and treat VAR='' as identical to completely unsetting VAR. It incorrectly assumes behavior that conflicts with the observed Linux conditions.
Incorrect Answers
B:This alternative addresses Account skeleton directory and default dotfiles, not the specific issue of Sourcing shell settings and removing variables: Edit the current administrator's ~/.bashrc and assume the account-creation utility automatically copies that live home directory to every new user. Linux principle: Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed. Appropriate response: Use source or the dot command to evaluate trusted configuration in the current shell, and use unset to remove the variable or function definition when required. Root-cause evidence: Compare shell variables before and after sourcing, inspect the variable with parameter expansion or env, and confirm unset changes definedness as intended. Independent acceptance: Required settings persist in the invoking shell and decommissioned variables no longer remain defined or exported into new children.
C:That option would assume every script ending in .sh is run by Bash automatically and that readable script files are always executable using ./script.sh, but it addresses a different concern. Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed.
D:This alternative addresses Quoting expansions in file-processing loops, not the specific issue of Sourcing shell settings and removing variables: Parse `ls` output with shell word splitting and remove files using unquoted variables because filenames never contain special characters. Linux principle: Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed. Appropriate response: Use source or the dot command to evaluate trusted configuration in the current shell, and use unset to remove the variable or function definition when required. Root-cause evidence: Compare shell variables before and after sourcing, inspect the variable with parameter expansion or env, and confirm unset changes definedness as intended. Independent acceptance: Required settings persist in the invoking shell and decommissioned variables no longer remain defined or exported into new children.
Question 46
An operations handoff identifies this problem: A session must remove a temporary token variable, yet the operator merely assigns it an empty string and concludes the variable is absent. Which administrative step is the MOST appropriate way to resolve this issue? Select ONE best answer.
- Expect executing ./setup.sh to modify its parent shell and treat VAR='' as identical to completely unsetting VAR.
- Use source or the dot command to evaluate trusted configuration in the current shell, and use unset to remove the variable or function definition when required.
- Export only required variables and construct a deliberately ordered PATH using trusted absolute directories; source a file when the current shell must receive its changes.
- Put login-specific exports in the appropriate user login profile and interactive aliases in ~/.bashrc, sourcing the interactive configuration from the login profile when desired.
Explanation
Correct Answer
B:Recommended administrative action: Use source or the dot command to evaluate trusted configuration in the current shell, and use unset to remove the variable or function definition when required.
Incorrect Answers
A:This shortcut is unsafe for the present Linux issue: Expect executing ./setup.sh to modify its parent shell and treat VAR='' as identical to completely unsetting VAR. It cannot establish a safe correction. Linux principle: Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed. Appropriate response: Use source or the dot command to evaluate trusted configuration in the current shell, and use unset to remove the variable or function definition when required. Root-cause evidence: Compare shell variables before and after sourcing, inspect the variable with parameter expansion or env, and confirm unset changes definedness as intended. Independent acceptance: Required settings persist in the invoking shell and decommissioned variables no longer remain defined or exported into new children.
C:This alternative addresses Safe PATH changes and environment export, not the specific issue of Sourcing shell settings and removing variables: Export only required variables and construct a deliberately ordered PATH using trusted absolute directories; source a file when the current shell must receive its changes. Linux principle: Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed. Appropriate response: Use source or the dot command to evaluate trusted configuration in the current shell, and use unset to remove the variable or function definition when required. Root-cause evidence: Compare shell variables before and after sourcing, inspect the variable with parameter expansion or env, and confirm unset changes definedness as intended. Independent acceptance: Required settings persist in the invoking shell and decommissioned variables no longer remain defined or exported into new children.
D:This alternative addresses Bash login and interactive startup files, not the specific issue of Sourcing shell settings and removing variables: Put login-specific exports in the appropriate user login profile and interactive aliases in ~/.bashrc, sourcing the interactive configuration from the login profile when desired. Linux principle: Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed. Appropriate response: Use source or the dot command to evaluate trusted configuration in the current shell, and use unset to remove the variable or function definition when required. Root-cause evidence: Compare shell variables before and after sourcing, inspect the variable with parameter expansion or env, and confirm unset changes definedness as intended. Independent acceptance: Required settings persist in the invoking shell and decommissioned variables no longer remain defined or exported into new children.
Question 47
A team maintaining a Linux host reports: A session must remove a temporary token variable, yet the operator merely assigns it an empty string and concludes the variable is absent. Which Linux behavior or technical principle BEST explains why the issue occurs? Select ONE best answer.
- Expect executing ./setup.sh to modify its parent shell and treat VAR='' as identical to completely unsetting VAR.
- Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed.
- Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file.
- Functions accept positional parameters and are shell constructs; aliases are mainly parsed in interactive shells and are not a reliable portable interface for executable scripts.
Explanation
Correct Answer
B:Relevant Linux operating principle: Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed.
Incorrect Answers
A:This shortcut is unsafe for the present Linux issue: Expect executing ./setup.sh to modify its parent shell and treat VAR='' as identical to completely unsetting VAR. Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed.
C:This alternative addresses Bash login and interactive startup files, not the specific issue of Sourcing shell settings and removing variables: Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file. Linux principle: Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed. Appropriate response: Use source or the dot command to evaluate trusted configuration in the current shell, and use unset to remove the variable or function definition when required. Root-cause evidence: Compare shell variables before and after sourcing, inspect the variable with parameter expansion or env, and confirm unset changes definedness as intended. Independent acceptance: Required settings persist in the invoking shell and decommissioned variables no longer remain defined or exported into new children.
D:This alternative addresses Bash functions versus aliases and command lookup, not the specific issue of Sourcing shell settings and removing variables: Functions accept positional parameters and are shell constructs; aliases are mainly parsed in interactive shells and are not a reliable portable interface for executable scripts. Linux principle: Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed. Appropriate response: Use source or the dot command to evaluate trusted configuration in the current shell, and use unset to remove the variable or function definition when required. Root-cause evidence: Compare shell variables before and after sourcing, inspect the variable with parameter expansion or env, and confirm unset changes definedness as intended. Independent acceptance: Required settings persist in the invoking shell and decommissioned variables no longer remain defined or exported into new children.
Question 48
While verifying a Linux change request, an engineer finds: A session must remove a temporary token variable, yet the operator merely assigns it an empty string and concludes the variable is absent. Which evidence or command result MOST directly tests the suspected root cause? Select ONE best answer.
- Compare shell variables before and after sourcing, inspect the variable with parameter expansion or env, and confirm unset changes definedness as intended.
- Expect executing ./setup.sh to modify its parent shell and treat VAR='' as identical to completely unsetting VAR.
- Test against filenames with spaces and glob characters, inspect quoted expansions and use a shell-safe enumeration in a throwaway directory.
- Run controlled success and failure commands, display or capture $?, inspect && and || order, and observe which branch actually executes.
Explanation
Correct Answer
A:Most direct verification evidence: Compare shell variables before and after sourcing, inspect the variable with parameter expansion or env, and confirm unset changes definedness as intended.
Incorrect Answers
B:This shortcut is unsafe for the present Linux issue: Expect executing ./setup.sh to modify its parent shell and treat VAR='' as identical to completely unsetting VAR. It cannot establish a safe correction. Linux principle: Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed.
C:This alternative addresses Quoting expansions in file-processing loops, not the specific issue of Sourcing shell settings and removing variables: Test against filenames with spaces and glob characters, inspect quoted expansions and use a shell-safe enumeration in a throwaway directory. Linux principle: Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed. Appropriate response: Use source or the dot command to evaluate trusted configuration in the current shell, and use unset to remove the variable or function definition when required. Root-cause evidence: Compare shell variables before and after sourcing, inspect the variable with parameter expansion or env, and confirm unset changes definedness as intended. Independent acceptance: Required settings persist in the invoking shell and decommissioned variables no longer remain defined or exported into new children.
D:That option would run controlled success and failure commands, display or capture $?, inspect && and || order, and observe which branch actually executes, but it addresses a different concern. Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed.
Question 49
A Linux administrator investigates the following system incident: A session must remove a temporary token variable, yet the operator merely assigns it an empty string and concludes the variable is absent. Which observed outcome BEST confirms a successful and properly scoped correction? Select ONE best answer.
- A newly created test user receives the intended accessible default files with correct ownership, while existing homes remain unchanged unless explicitly migrated.
- Parameterized helper calls behave correctly for supplied arguments and any script does not depend on an uninitialized interactive alias.
- Expect executing ./setup.sh to modify its parent shell and treat VAR='' as identical to completely unsetting VAR.
- Required settings persist in the invoking shell and decommissioned variables no longer remain defined or exported into new children.
Explanation
Correct Answer
D:Observable acceptance criterion: Required settings persist in the invoking shell and decommissioned variables no longer remain defined or exported into new children.
Incorrect Answers
A:This alternative addresses Account skeleton directory and default dotfiles, not the specific issue of Sourcing shell settings and removing variables: A newly created test user receives the intended accessible default files with correct ownership, while existing homes remain unchanged unless explicitly migrated. Linux principle: Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed. Appropriate response: Use source or the dot command to evaluate trusted configuration in the current shell, and use unset to remove the variable or function definition when required. Root-cause evidence: Compare shell variables before and after sourcing, inspect the variable with parameter expansion or env, and confirm unset changes definedness as intended. Independent acceptance: Required settings persist in the invoking shell and decommissioned variables no longer remain defined or exported into new children.
B:This alternative addresses Bash functions versus aliases and command lookup, not the specific issue of Sourcing shell settings and removing variables: Parameterized helper calls behave correctly for supplied arguments and any script does not depend on an uninitialized interactive alias. Linux principle: Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed. Appropriate response: Use source or the dot command to evaluate trusted configuration in the current shell, and use unset to remove the variable or function definition when required. Root-cause evidence: Compare shell variables before and after sourcing, inspect the variable with parameter expansion or env, and confirm unset changes definedness as intended. Independent acceptance: Required settings persist in the invoking shell and decommissioned variables no longer remain defined or exported into new children.
C:This shortcut is unsafe for the present Linux issue: Expect executing ./setup.sh to modify its parent shell and treat VAR='' as identical to completely unsetting VAR. Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed.
Question 50
On a production Linux workstation or server, a technician observes: A session must remove a temporary token variable, yet the operator merely assigns it an empty string and concludes the variable is absent. Which TWO complementary steps provide the best corrective action and its most direct diagnostic verification? Select TWO answers.
- Expect executing ./setup.sh to modify its parent shell and treat VAR='' as identical to completely unsetting VAR.
- Compare env and shell variable output, inspect PATH for empty or writable directories, and run type -a or command -v for the intended executables.
- Maintain approved default dotfiles and directory templates under /etc/skel and use the appropriate account-creation option to populate new home directories.
- Compare shell variables before and after sourcing, inspect the variable with parameter expansion or env, and confirm unset changes definedness as intended.
- Use source or the dot command to evaluate trusted configuration in the current shell, and use unset to remove the variable or function definition when required.
Explanation
Correct Answers
D:Most direct verification evidence: Compare shell variables before and after sourcing, inspect the variable with parameter expansion or env, and confirm unset changes definedness as intended. Linux principle: Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed.
E:Recommended administrative action: Use source or the dot command to evaluate trusted configuration in the current shell, and use unset to remove the variable or function definition when required. Linux principle: Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed.
Incorrect Answers
A:This shortcut is unsafe for the present Linux issue: Expect executing ./setup.sh to modify its parent shell and treat VAR='' as identical to completely unsetting VAR. Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed.
B:That option would compare env and shell variable output, inspect PATH for empty or writable directories, and run type -a or command -v for the intended executables, but it addresses a different concern. Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed.
C:That option would maintain approved default dotfiles and directory templates under /etc/skel and use the appropriate account-creation option to populate new home directories, but it addresses a different concern. Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed.