Which of the following files is not read directly by a Bash login shell?
Which of the following files is not read directly by a Bash login shell?
When a Bash login shell starts, it reads and executes commands from specific initialization files in a set order. It first looks for /etc/profile, and then checks for ~/.bash_profile, ~/.bash_login, and ~/.profile. It will read and execute commands from the first file it finds among these that exists and is readable. The file ~/.bashrc, on the other hand, is typically read during the invocation of a non-login interactive shell. Thus, the file ~/.bashrc is not read directly by a Bash login shell.
It is read as part of interactive non-login shell and hence to directly referenced Read from the BIBLE :) https://learning.lpi.org/en/learning-materials/102-500/105/105.1/105.1_01/
i mean by saying hence NOT directly referenced
B (if available) + E are only read in when logging on to the system. C is an alternative of B and is only read if B is not present. D is only read at logon if neither B nor C is present. A is the correct answer! Book page 299 Harald Maaßen "LPIC-1 Secure for successful Linux certification".
(A) is definitely correct, see source: https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html
infact bash read the config files in this order.. /etc/profile -> ~/.bash_profile -> ~/.bash_login -> ~/.profile, at the exit -> ~/.bash_logout
This is absolutely true
Well done. Just mention that ~/.profile is only read if ~/.bash_profile and ~/.bash_login aren't present.
The correct answer is A
answer is A
Correct, ~/.bashrc read directly from Interactive shell, not Bash Login Shell. https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html
Correct answer, "/home/user/.bashrc executes (sourced from the user’s .bash_profile or .profile)" it's not read from bash_login
When Bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. The --noprofile option may be used when the shell is started to inhibit this behavior. When an interactive login shell exits, or a non-interactive login shell executes the exit builtin command, Bash reads and executes commands from the file ~/.bash_logout, if it exists. So the correct Answer is A which read with a bash non-login shell
correct answer is D
the correct is E