Question 1
Topic: Topic 105: Shells and Shell Scripting
Skill tested: Configures Bash login and interactive-shell startup files to set user-specific environment variables.
A support team needs a user-specific tool directory added to PATH for both graphical logins and interactive Bash shells. The user's login shell is Bash, and the directory must appear only once in PATH even when nested interactive shells are started. The organization does not permit changing global startup files, and non-interactive scripts should not inherit unrelated interactive configuration. Which approach best meets these requirements?
A login Bash shell reads an appropriate login profile, while interactive non-login Bash shells read ~/.bashrc. A guarded update in ~/.profile establishes the path for login sessions; sourcing that profile from interactive non-login shells provides the same setting there. Checking whether the directory is already present prevents duplicate entries. A sources interactive configuration from scripts, B duplicates the update in two files, and D changes global configuration despite the restriction and does not properly configure PATH.