Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple root account? 1

Status
Not open for further replies.

t0shiba3

Technical User
Jan 18, 2001
10
GB
When i su - from my user and entry passwd i get to # however if i change the .profile and reread it changes are not applied. However if i type exit to get back to my user i get to PS1 prompt ie ddeefrs1> which is still root and the changes to the .profile are now implemented. Its almost as if there is two root accounts but checking /etc/passwd shows just one. The .profile does point to the ddeefrs1> as the line to create this login prompt is here
am i missing something really simple here?

paul
 
Paul,

When you say "and reread it" what do you mean exactly?
Mike
michael.j.lacey@ntlworld.com
 
Sounds like that it is working correctly. You have to logout or source .profile to implement the change.
 
Hi paul,
I think you are starting a subshell when you are executing your .profile. In that case you won't get the settings immediately.I will give a simple example of your situation.

----------------
#cat /.profile

echo "this is the .profile of root"
ksh
PS1="Prompt >"
----------------
In this case you won't get the prompt as "Prompt >" immediately because You will be working with the subshell you are starting in the second line.Once you give exit command , the third line starts executing and you will get the prompt as "prompt >".Note that still you will be in root user.You need one more exit to switch to your user.



Hope my answer is related to your question.

Suresh
 
Thanks shurshp, the .profile is quite complex here and i had missed the ksh which was starting the subshell

paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top