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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-30-2006
shellburger shellburger is offline
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.
  #2 (permalink)  
Old 08-30-2006
Corona688 Corona688 is offline
Registered User
  
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 1,969
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.
  #3 (permalink)  
Old 08-30-2006
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,245

Code:
uname -n


Code:
hostname


Code:
getent hosts `hostname`

  #4 (permalink)  
Old 08-31-2006
shellburger shellburger is offline
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.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:41 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0