The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Change hostname madmat Linux 3 09-20-2007 07:23 AM
Solaris - unknown hostname - how can I change hostname? XNOR UNIX for Dummies Questions & Answers 1 03-29-2007 07:52 PM
looking up hostname dangral IP Networking 2 10-28-2003 01:56 PM
Printing Problems in unix ... ( Bar-cdoe - Ip Printing) QuickSilver UNIX for Advanced & Expert Users 3 06-04-2002 07:48 AM
Hostname bache_gowda UNIX for Dummies Questions & Answers 1 09-22-2001 01:25 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #8  
Old 05-29-2008
sysgate's Avatar
Unix based
 

Join Date: Nov 2006
Location: /root
Posts: 1,200
Note the backticks around the "hostname" ---- `hostname` this executes command in a sub-shell and returns the value to the parent one. The other way is, as you have been told, to use the HOSTNAME variable, which is set on every session, verify with : "env | grep -i hostname" - you will receieve : HOSTNAME=your.host.name
In script, just call the variable, as in : echo $HOSTNAME.
Reply With Quote
Google The UNIX and Linux Forums
Forum Sponsor
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 07:31 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0