You have edited /etc/profile to include the lines:
dennis_says=hello
export dennie_says
You have also edited /etc/skel/local.profile to include the line:
dennis_says=world
You now create a new user account brian, and specify use of the bash shell. When brian logs in
and enters
Echo $dennis_says
What will he see, and why?
A.
world, because the local.profile entry will be executed last
B.
hello, because the global /etc/profile entry overrides the local.profile entry
C.
hello, because the local.profile entry is not automatically sourced on login
D.
hello, because the value specified in local.profile was not exported
E.
nothing, because the variable was not exported in local.profile
Explanation:
The $HOME/.profile file is an initialization file that is executed after the /etc/profile
when logging in to the Bourne or Korn shell. The file contains user preferences for variable
settings. If the ENV variable is set to .kshrc, the .kshrc file executes every time a new shell begins
execution. The $HOME/.profile is copied from the /etc/skel/local.profile file by the Administration
Tool when creating a new account.
Note: /etc/skel/local.profile
Per-system configuration file for
sh/ksh/ksh93/bash login sessions,
installed for new users
C
i go with C..
or D..
I think A is the correct one, cuz at the head of /etc/profile you can read the following lines:
# more /etc/profile
#
# Copyright (c) 1989, 2012, Oracle and/or its affiliates. All rights reserved.
#
# The profile that all logins get before using their own .profile.
…there are typos… “dennie” and “dennis” ….
C is the correct
https://docs.oracle.com/cd/E23824_01/html/821-1451/userconcept-23295.html
i have tried all the scenarios
and C was the correct option