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
Running a Script in a Remote server ZeroGPX Shell Programming and Scripting 2 03-07-2008 05:07 PM
How to find Packages running on a server venu_nbk UNIX for Dummies Questions & Answers 4 07-27-2006 01:29 AM
Running a script in a server from another server csaha Shell Programming and Scripting 2 02-16-2006 02:11 AM
Running a remote Server through perl script chandrak Shell Programming and Scripting 0 02-12-2006 09:25 PM
running a script on remote server. whited05 Shell Programming and Scripting 1 10-20-2005 02:07 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 08-30-2006
Registered User
 

Join Date: Jul 2005
Posts: 4
find the server name a script is running on

Is there any kind of command I can use to find out the name or IP address of the server I am currently on? We have a script that exists on multiple servers and I'd like to set a variable differently based on what server I am on.
Reply With Quote
Forum Sponsor
  #2  
Old 08-30-2006
Registered User
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 989
What OS?

Even better than the IP would be the mac address of the network card. /sbin/ifconfig ought to work on a lot of systems to dump all sorts of info, but you can get more specific if you know the system.
Reply With Quote
  #3  
Old 08-30-2006
reborg's Avatar
Administrator
 

Join Date: Mar 2005
Location: Ireland
Posts: 3,644
Code:
uname -n
Code:
hostname
Code:
getent hosts `hostname`
Reply With Quote
  #4  
Old 08-30-2006
Registered User
 

Join Date: Jul 2005
Posts: 4
thanks - that worked perfectly.
I'll remember to include my OS next time - it's sun solaris.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 02:48 AM.


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