which of the following sentences is true?

When bash is invoked as an interactive login shell, which of the following sentences is true?

When bash is invoked as an interactive login shell, which of the following sentences is true?

A.
It first reads and executes commands in /etc/profile and then does the same for ~/.bash_profile,~/.bash_login and ~/.profile.

B.
It first reads and executes commands in /etc/bashrc and then does the same for /etc/profile.

C.
It reads and executes commands in ~/.bashrc only if /etc/profile or another initialisation script calls it.

D.
It ignores /etc/profile and only reads and executes commands in ~/.bashrc.

E.
It first reads and executes commands in /etc/profile and then does same for ~/.bash_profile and~/.bashrc.

Explanation:
Startup Scripts:
For Login shell provided users:
i. /etc/profile which calls /etc/profile.d/*.sh
ii. ~./bash_profile
iii. ~/.bashrc
iv. /etc/bashrc

For non-Login Shell provided users:
1. ~/.bashrc
2. /etc/bashrc which calls /etc/profile.d/*.sh



Leave a Reply 3

Your email address will not be published. Required fields are marked *


walim

walim

According to the explanation, the right answer should be E and not B

admin

admin

For Login shell provided users, we need 4 commands, but answer E miss one command(/etc/bashrc). Conversely, answer B is correct for non-Login Shell provided users.

bob

bob

I see some of the questions are out of syllabus, this is one of them.
LX0-102
105.1 customize and use the shell envi