- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- HOST in perl
Operating System - Linux
1820882
Members
3440
Online
109628
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
Discussions
Discussions
Discussions
Forums
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
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
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
тАО03-06-2008 09:02 AM
тАО03-06-2008 09:02 AM
thanks to H Merijn Brand for his answer to
the thread
displaying hostname on xterm window titlebar
June 6 2005
tinyurl is not allowed :(
Here is the code I put in .kshrc
HOST=$HOST; export HOST
perl -le'print "\e]0;$ENV{HOST}\7"'
from perl I printed out %ENV but HOST was not there so I added the HOST=$HOST line above it
why do I need to explicity set HOST on HP-UX?
the thread
displaying hostname on xterm window titlebar
June 6 2005
tinyurl is not allowed :(
Here is the code I put in .kshrc
HOST=$HOST; export HOST
perl -le'print "\e]0;$ENV{HOST}\7"'
from perl I printed out %ENV but HOST was not there so I added the HOST=$HOST line above it
why do I need to explicity set HOST on HP-UX?
Solved! Go to Solution.
- Tags:
- Perl
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-06-2008 09:26 AM
тАО03-06-2008 09:26 AM
Solution
Hi Peter:
You are declaring and exporting the variable (and its value) called "HOST" to the running environment. THen, and only then, does Perl find it.
I would expect that the declaration and export might look like:
# HOST=$(hostname); export HOST
...or:
# HOST=servername; export HOST
If you want to see all the variables and their values in your environment, do:
perl -le 'for $key (keys %ENV) {print "$key => $ENV{$key}"}'
Regards!
...JRF...
You are declaring and exporting the variable (and its value) called "HOST" to the running environment. THen, and only then, does Perl find it.
I would expect that the declaration and export might look like:
# HOST=$(hostname); export HOST
...or:
# HOST=servername; export HOST
If you want to see all the variables and their values in your environment, do:
perl -le 'for $key (keys %ENV) {print "$key => $ENV{$key}"}'
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-06-2008 09:42 AM
тАО03-06-2008 09:42 AM
Re: HOST in perl
> HOST=$HOST; export HOST
Here you assign the value of $HOST to $HOST, which is a no-op
if $HOST is not set in your shell (I use the tcsh), you better do it like
export HOST=`hostname`
or
export HOST=$(hostname)
or something similar, there are so many ways to do that
> perl -le'print "\e]0;$ENV{HOST}\7"'
maybe you have another variable that reflects your hostname?
Enjoy, Have FUN! H.Merijn
Here you assign the value of $HOST to $HOST, which is a no-op
if $HOST is not set in your shell (I use the tcsh), you better do it like
export HOST=`hostname`
or
export HOST=$(hostname)
or something similar, there are so many ways to do that
> perl -le'print "\e]0;$ENV{HOST}\7"'
maybe you have another variable that reflects your hostname?
Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
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
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP