- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Variable Question
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
02-19-2007 08:29 AM
02-19-2007 08:29 AM
Variable Question
export HostName=`/usr/ucb/hostname`
OR whether it should be
HostName=`/usr/ucb/hostname`
thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2007 08:34 AM
02-19-2007 08:34 AM
Re: Variable Question
Well, for HP-UX if you want to capture the server hostname and provide it to processes started after login, you would place this in the users '.profile':
# export HostName=`/usr/bin/hostname`
(or, using the preferred POSIX form)
# export HostName=$(/usr/bin/hostname)
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2007 09:00 AM
02-19-2007 09:00 AM
Re: Variable Question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2007 09:19 AM
02-19-2007 09:19 AM
Re: Variable Question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2007 03:54 PM
02-19-2007 03:54 PM
Re: Variable Question
It is always better to export a variable if it is used very frequently and also if its value doesn't change very frequently.
also it should be user specific and hence it is appropriate to include this in the .profile file for a user.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2007 08:19 PM
02-19-2007 08:19 PM
Re: Variable Question
if you want to have the full name of teh host:
export HstNam=$(hostname|nslookup|awk '/^Name:/ {print $2}')
bosth hostname and nslookup are in /usr/bin, but I think you don't need to sue teh fullpath, usially /usr/bin is included in default path.
HTH,
Art
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2007 09:10 PM
02-19-2007 09:10 PM
Re: Variable Question
We normally export such things which we used regularly. Hostname is common one.
option is :
# export HostName=$(/usr/bin/hostname)
Regards
Reshma