When brian logs in and asks for the value of genius, what will he find, and why?

A user brian is configured to use the bash shell. His home directory is /export/home/brian, and contains a .profile and a .bashrc file.
In the -profile, there are these lines:
genius =ritchie export genius
In the .bashrc us this line:
genius=kernighan
In /etc/profile are these lines:
genius=thompson
export genius
When brian logs in and asks for the value of genius, what will he find, and why?
A. genius will be ritchie, because that was the value exported in .profile.
B. genius will be kernighan, because .bashrc executes after .profile.
C. genius will be ritchie because variable settings in .profile take precedence over variable settings in .bashrc.
D. genius will be ritchie because .profile executes after .bashrc.
E. genius will be thompson because /etc/profile system settings always override local settings.

Download Printable PDF. VALID exam to help you PASS.

One thought on “When brian logs in and asks for the value of genius, what will he find, and why?

  1. Answer = A
    .profile overrides /etc/profile. genius is exported in .profile.

    .bashrc is not used in interactive logins.

  2. it is answer C, but there is no precedence involved, when user logs in/has interactive session .bashrc is never even looked up !!!! So it should actually state that .profile is executed after /etc/profile therefore genius=ritchie

Leave a Reply

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


The reCAPTCHA verification period has expired. Please reload the page.