HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: PS1 variable being set for
Operating System - HP-UX
1834149
Members
2256
Online
110064
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2004 07:48 AM
05-27-2004 07:48 AM
PS1 variable being set for
I am running hp-ux 11.i with BASH 2.05.
I have added the line:
export PS1="\u@\h:\w\\n \#\\$ "
in /etc/profile. This file has been linked to /etc/dt/config/Xsession.d/profile so that it will be read by xwindow logons as well.
The problem is that the PS1 varable is not working when loging in to xwindows. Other variables in profile are exported fine.
I have searched for other locations that may be ovewriting this PS1 variable and have found none.
Any suggestions on this would be appreciated.
Thanks in advance,
Keith
I have added the line:
export PS1="\u@\h:\w\\n \#\\$ "
in /etc/profile. This file has been linked to /etc/dt/config/Xsession.d/profile so that it will be read by xwindow logons as well.
The problem is that the PS1 varable is not working when loging in to xwindows. Other variables in profile are exported fine.
I have searched for other locations that may be ovewriting this PS1 variable and have found none.
Any suggestions on this would be appreciated.
Thanks in advance,
Keith
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2004 08:15 AM
05-27-2004 08:15 AM
Re: PS1 variable being set for
Check:
DTSOURCEPROFILE=true
in .dtprofile
Rgds...Geoff
DTSOURCEPROFILE=true
in .dtprofile
Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2004 08:40 AM
05-27-2004 08:40 AM
Re: PS1 variable being set for
Geoff
Thanks for the response
DTSOURCEPROFILE is currently set to true in .dtprofile.
I have tried to rem this line out and it has not made any difference to the PS1 variable. When I rem it out, other variables, including the DISPLAY variable does not get set correctly. Therefore I currently have DTSOURCEPROFILE=true.
Keith
Thanks for the response
DTSOURCEPROFILE is currently set to true in .dtprofile.
I have tried to rem this line out and it has not made any difference to the PS1 variable. When I rem it out, other variables, including the DISPLAY variable does not get set correctly. Therefore I currently have DTSOURCEPROFILE=true.
Keith
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2004 02:04 PM
05-27-2004 02:04 PM
Re: PS1 variable being set for
It is VERY common for workstation users or users that run CDE and terminal emulators to access HP-UX to not login 'normally'. This is because the default for CDE (and the obsolete VUE product) is for dtterm, xterm and hpterm NOT to run /etc/profile or .profile during login. (similarly for csh user, the /etc/csh.login file and .cshrc) The reasons behind the Xwindow behavior are obscure but nevertheless quite frustrating.
However, there is an easy fix: In each $HOME directory (the home directory for each user login), perform this task once:
echo "*loginShell: true" >> $HOME/.Xdefaults
Now when the user starts a remote terminal window such as hpterm or dtterm or xterm, the 'normal' Unix login process will be followed and both /etc/profile (the usual place to put ORACLE_HOME and other environmental settings) and $HOME/.profile will be executed.
Note that the CDE variable DTSOURCEPROFILE only affects .profile so it misses the important /etc/profile file. And you can also add the loginShell directive to the startup of dtterm, hpterm or xterm (the option is -ls).
Now if you do not use Xwindows, then verify that your users have a standard shell (/usr/bin/sh or /usr/bin/ksh). Shells like csh, bash, tcsh, etc, should ALWAYS be avoided (better yet: forbidden) on production servers as they create sysadmin nightmares for support. And to see if /etc/profile and the local .profile are really being executed, put a print or an echo at the front of both files so you know they are being run:
echo "...Now running /etc/profile..."
or
echo "...Now running $HOME/.profile..."
If this works OK but the values are still not set, use the shell script trace option as in:
sh -x /etc/profile
or
sh -x $HOME/.profile
For users with a problem.
Bill Hassell, sysadmin
However, there is an easy fix: In each $HOME directory (the home directory for each user login), perform this task once:
echo "*loginShell: true" >> $HOME/.Xdefaults
Now when the user starts a remote terminal window such as hpterm or dtterm or xterm, the 'normal' Unix login process will be followed and both /etc/profile (the usual place to put ORACLE_HOME and other environmental settings) and $HOME/.profile will be executed.
Note that the CDE variable DTSOURCEPROFILE only affects .profile so it misses the important /etc/profile file. And you can also add the loginShell directive to the startup of dtterm, hpterm or xterm (the option is -ls).
Now if you do not use Xwindows, then verify that your users have a standard shell (/usr/bin/sh or /usr/bin/ksh). Shells like csh, bash, tcsh, etc, should ALWAYS be avoided (better yet: forbidden) on production servers as they create sysadmin nightmares for support. And to see if /etc/profile and the local .profile are really being executed, put a print or an echo at the front of both files so you know they are being run:
echo "...Now running /etc/profile..."
or
echo "...Now running $HOME/.profile..."
If this works OK but the values are still not set, use the shell script trace option as in:
sh -x /etc/profile
or
sh -x $HOME/.profile
For users with a problem.
Bill Hassell, sysadmin
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP