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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PS1 variable

Status
Not open for further replies.
Nov 6, 2001
77
US
I'm having trouble with the PS1 variable and root. If I su - root, there is no problem, but if I su root I only get the prompt, no hostname:directory.
I have the variable set as follows:
export PS1="`hostname`:"'$PWD >'

and it's set in /.profile , /etc/skel/local.profile, /etc/profile, and the users .profile
# echo $PS1
#
When I su root, and export PS1 from the command line, it's fine, root is using ksh.

Thanks
 
su without the - retains the environment it was invoked with. To invoke root's .profile always use su - root. Cheers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top