![]() |
|
|
|
|
|||||||
| 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 |
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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.
|
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
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
|
||||
|
||||
|
Code:
uname -n Code:
hostname Code:
getent hosts `hostname` |
|
#4
|
|||
|
|||
|
thanks - that worked perfectly.
I'll remember to include my OS next time - it's sun solaris. |
|||
| Google The UNIX and Linux Forums |