- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- .profile POSIX shell
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
Forums
Discussions
Discussions
Discussions
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
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
04-04-2002 06:59 AM
04-04-2002 06:59 AM
In .profile
export PS1='$LOGNAME@$hostname: $PWD $'
All I get is a blank space. Is the hostname not loaded at startup?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2002 07:04 AM
04-04-2002 07:04 AM
Re: .profile POSIX shell
export PS1='$LOGNAME@`hostname`: $PWD $'
which uses the command 'hostname' in backticks, or
export PS1='$LOGNAME@$HOST: $PWD $'
using the environment variable $HOST, which is not always set, so I'd go for the backtick way
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2002 07:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2002 07:06 AM
04-04-2002 07:06 AM
Re: .profile POSIX shell
PS1=`uname -n`:`id -un`:'${PWD}''# '\
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2002 07:06 AM
04-04-2002 07:06 AM
Re: .profile POSIX shell
If you just want the hostname at the prompt, add this to the .profile:
PS1="`hostname`# "
HTH,
Shiju
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2002 07:07 AM
04-04-2002 07:07 AM
Re: .profile POSIX shell
You can also do a:
export PS1="$LOGNAME@`hostname`:$PWD $"
(using dubble-quotes and back-quotes); this works just fine too.
Regards,
Ceesjan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2002 07:07 AM
04-04-2002 07:07 AM
Re: .profile POSIX shell
with
export PS1=$LOGNAME@`hostname`':$PWD: '
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2002 07:09 AM
04-04-2002 07:09 AM
Re: .profile POSIX shell
# export PS1="$LOGNAME@$(hostname): $PWD $"
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2002 07:11 AM
04-04-2002 07:11 AM
Re: .profile POSIX shell
I beat you, being the first :)))
N/A
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2002 07:20 AM
04-04-2002 07:20 AM
Re: .profile POSIX shell
post it works great.
procura post only returns hostname not the actual host name. Sorry
As for the others I have not tried them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2002 07:21 AM
04-04-2002 07:21 AM
Re: .profile POSIX shell
this is the prompt i use. in the .profile file:
**
PWD=`pwd`
HOST=`hostname`
PS1='$HOST@$PWD>'
export PWD HOST PS1
**
HTh
raj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2002 07:25 AM
04-04-2002 07:25 AM
Re: .profile POSIX shell
export PS1='$LOGNAME@'`hostname`': $PWD $'
should be it
I should have known it would be toooo easy :0
The comments however still hold
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2002 07:36 AM
04-04-2002 07:36 AM
Re: .profile POSIX shell
and another combination:
export PS1="$LOGNAME@`hostname`:\$PWD\$ "
RGDS, Holger