You can use if-then-else
Or a case-statement might be simpler.
[/code]
Maybe you can use the host command to get the IP address (but I think you're using Solaris, and I'm not sure if the host command is available there), otherwise nslookup if it's in DNS.
I want to find a program that can run in DOS, login to a ssh/telnet server, then run a specifed command to do a daily jobs, can anyone tell me is there any application i can find in the internet? (2 Replies)
Hello,
I am new to Solaris.
I am using stand alone Solaris 10.0 for test/study purpose and connecting to internet via an ADSL modem which has DHCP server. My Solaris is working on VMWare within winXP. My WinXP and Solaris connects to internet by the same ADSL modem via its DHCP at the same... (1 Reply)
I am trying to figure out a way to proceed through a menu-based program in UNIX with just one command to execute several steps. Is this possible?
From the command prompt I would normally type the name of the program, 'disk_analysis' to start the program and bring up its menu.
I would then... (4 Replies)
Hello!
I am trying to run a program which has used Xlib for its graphical user interface on Solaris through Common Desktop Environment(CDE). All I get is my three required widows open but all blank.They suppose to show some symbols, pictures ad buttons.In the command terminal the following... (1 Reply)
Hi All,
So we added a new HP-UX 11.31 machine. Copied OS via Ignite-UX (DVD)over from this machine called machine_a. It was supposed to be named machine_c. And it is when you log in...however when I'm in the ILO console before logging in, it says:
It should say:
What gives? And how do... (4 Replies)
Hey!
I'm new to C. I need to covert certain values using C. please see the below. I have figured out the logic to do it. Please provide some hints to do this with C
Logic:
If first position of POS = 0, shift POS to the left one byte.
If third position of POS = 0, move spaces to third... (1 Reply)
Dear all
I have a bunch of hosts which I need to run a common script. I need a sleep timee which will delay the execution based on the hostname. Usually the hostname of the servers are host01, host02 .. host16 with which I cam up with this -
#!/bin/bash
sleeptimer=$(( $(hostname -s|tr -cd... (3 Replies)
GEOIP_CONTINENT_CODE_BY_NAME(3) 1 GEOIP_CONTINENT_CODE_BY_NAME(3)geoip_continent_code_by_name - Get the two letter continent codeSYNOPSIS
string geoip_continent_code_by_name (string $hostname)
DESCRIPTION
The geoip_continent_code_by_name(3) function will return the two letter continent code corresponding to a hostname or an IP address.
PARAMETERS
o $hostname
- The hostname or IP address whose location is to be looked-up.
RETURN VALUES
Returns the two letter continent code on success, or FALSE if the address cannot be found in the database.
Continent codes
+-----+----------------+
|Code | |
| | |
| | Continent name |
| | |
+-----+----------------+
| | |
| AF | |
| | |
| | Africa |
| | |
| | |
| AN | |
| | |
| | Antarctica |
| | |
| | |
| AS | |
| | |
| | Asia |
| | |
| | |
| EU | |
| | |
| | Europe |
| | |
| | |
| NA | |
| | |
| | North america |
| | |
| | |
| OC | |
| | |
| | Oceania |
| | |
| | |
| SA | |
| | |
| | South america |
| | |
+-----+----------------+
EXAMPLES
Example #1
A geoip_continent_code_by_name(3) example
This will print where the host example.com is located.
<?php
$continent = geoip_continent_code_by_name('www.example.com');
if ($continent) {
echo 'This host is located in: ' . $continent;
}
?>
The above example will output:
This host is located in: NA
SEE ALSO geoip_country_code_by_name(3).
PHP Documentation Group GEOIP_CONTINENT_CODE_BY_NAME(3)