![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#8
|
||||
|
||||
|
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. |
||||
| Google The UNIX and Linux Forums |
| Forum Sponsor | ||
|
|