- Community Home
- >
- Servers and Operating Systems
- >
- Legacy
- >
- Operating System - Tru64 Unix
- >
- Re: How to display hostname in front of the "#"
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
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
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- 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
тАО06-23-2004 06:04 PM
тАО06-23-2004 06:04 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2004 06:59 PM
тАО06-23-2004 06:59 PM
Re: How to display hostname in front of the "#"
Login as root, open the .profile file existing under /
at the end of the .profile file add
PS1=#`hostname`
save and close the file
#. ./.profile
now you prompt will be
#
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2004 08:48 PM
тАО06-23-2004 08:48 PM
Re: How to display hostname in front of the "#"
In addition to above.
Don't forget use export PS1
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2004 09:00 PM
тАО06-23-2004 09:00 PM
Re: How to display hostname in front of the "#"
no need to export, as the .profile will be executed whenever the user login
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2004 09:57 PM
тАО06-23-2004 09:57 PM
Re: How to display hostname in front of the "#"
I would go for:
PS1='prc60b22:$PWD # '
This adds the server name and displays the current dir.
HTH,
Gideon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2004 09:59 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-24-2004 06:35 AM
тАО06-24-2004 06:35 AM
Re: How to display hostname in front of the "#"
You probably want to do something as suggested in the previous replies. However if you're not interested in the fully qualified domain name, I suggest something like this:
typeset host=$(uname -n)
PS1="${host%%.*}# "
Possibly in combination with other things of course. Similar solutions are possible on csh, tcsh, etc. The man pages for the shells are usually helpful.