Does anybody know if HP-UX uses any other directories besides /var/spool/lp/request to spool print jobs? I checked the man pages, and it only mentions /var/spool/lp in general. I was just wondering if anyone knew of some other place it might possibly use. thanks in advance for any help! (2 Replies)
i have a script in which awk prints "($2-1700)/10000"
and the answer is -0.07,but i want the answer in 4 decimal places.
that is -0.0700.
How can i sue awk to get my results in four decimal places (4 Replies)
i need to multiplay a number with 1.00.. so that the output should contain two decimal places at end..
for example...
236 * 1.00 = 236.00
245.8 * 1.00 = 245.80
but when i perform multiplication it shows output as.
236
245.8
can anyone help me to get the actual output of... (11 Replies)
Hi all,
I have to insert underscore at certain places(places before and after PAxxx/PAxxxx entries in a big file like this
ESR1 PA156 leflunomide PA450192
CHST3 PA26503 docetaxel tungstate Pa4586; thalidomide Pa34958;
PAxxx/PAxxxx entries are metioned between 2 names in each row
... (4 Replies)
Below is my requirement.
When I type 'ls' from the command prompt,
1. I need the output/listing to be shown on screen(which happens by default)
2. Also a file named a.txt should be populated with the output of 'ls' comma nd.
How should I do this?
-Yuvaraj. (2 Replies)
cat emp.lst
12 |Rob Cliff |G.M.
14 |Mark Rob |Chairman
Please use awk to invert the names in the file emp.lst, i.e. the surname should be 1st and then the 1st name. There are trailing spaces even in each field making them fixed length. (4 Replies)
Hello Team,
We would like to copy or sync a couple a zpool and all dataset inside between two datacenters one time per day, the structure and space are the same in both sides.
We are consider to use rsync and a cron job.
We would like to know what type of ports we have to open in the... (1 Reply)
I dont know why this Linux would give me badly placed () error all the time for this;
#include <stdio.h>
int main()
{
register int num=0 ;
while ((num < 5))
++num;
printf("Pass %d \n", num) ;
return 0 ;
}
can anyone help me please? (11 Replies)
I used the below script to Sum up a field in a file based on some unique values. But the problem is when it is summing up the units, it is truncating to 2 decimals and not 6 decimals as in the input file (Input file has the units with up to 6 Decimals – Sample data below, when the units in the 2... (4 Replies)
Discussion started by: brlsubbu
4 Replies
LEARN ABOUT PHP
ip2long
IP2LONG(3) 1 IP2LONG(3)ip2long - Converts a string containing an (IPv4) Internet Protocol dotted address into a proper addressSYNOPSIS
int ip2long (string $ip_address)
DESCRIPTION
The function ip2long(3) generates an IPv4 Internet network address from its Internet standard format (dotted string) representation.
ip2long(3) will also work with non-complete IP addresses. Read http://publibn.boul-
der.ibm.com/doc_link/en_US/a_doc_lib/libs/commtrf2/inet_addr.htm for more info.
PARAMETERS
o $ip_address
- A standard format address.
RETURN VALUES
Returns the IPv4 address or FALSE if $ip_address is invalid.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
|5.2.10 | |
| | |
| | Prior to this version, ip2long(3) would some- |
| | times return a valid number even if passed an |
| | value which was not an (IPv4) Internet Protocol |
| | dotted address. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
ip2long(3) Example
<?php
$ip = gethostbyname('www.example.com');
$out = "The following URLs are equivalent:<br />
";
$out .= 'http://www.example.com/, http://' . $ip . '/, and http://' . sprintf("%u", ip2long($ip)) . "/<br />
";
echo $out;
?>
Example #2
Displaying an IP address
This second example shows how to print a converted address with the printf(3) function in both PHP 4 and PHP 5:
<?php
$ip = gethostbyname('www.example.com');
$long = ip2long($ip);
if ($long == -1 || $long === FALSE) {
echo 'Invalid IP, please try again';
} else {
echo $ip . "
"; // 192.0.34.166
echo $long . "
"; // -1073732954
printf("%u
", ip2long($ip)); // 3221234342
}
?>
NOTES
Note
Because PHP's integer type is signed, and many IP addresses will result in negative integers on 32-bit architectures, you need to
use the "%u" formatter of sprintf(3) or printf(3) to get the string representation of the unsigned IP address.
Note
ip2long(3) will return FALSE for the IP 255.255.255.255 in PHP 5 <= 5.0.2. It was fixed in PHP 5.0.3 where it returns -1 (same as
PHP 4).
SEE ALSO long2ip(3), sprintf(3).
PHP Documentation Group IP2LONG(3)