summaryrefslogtreecommitdiff
path: root/gettest
blob: 565ae82bc677404ff6d3dc777dd0b88c08f75e45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!./perl

    while (($name,$aliases,$addrtype,$length,@addrs) = gethostent) {
	print $name,' ',$aliases,
	  sprintf(" %d.%d.%d.%d\n",unpack('CCCC',$addrs[0]));
	last if $i++ > 50;
    }
    <stdin>;
    while (($name,$aliases,$addrtype,$net) = getnetent) {
	print "$name $aliases $addrtype ",sprintf("%08lx",$net),"\n";
    }
    <stdin>;
    while (($name,$aliases,$proto) = getprotoent) {
	print "$name $aliases $proto\n";
    }
    <stdin>;
    while (($name,$aliases,$port,$proto) = getservent) {
	print "$name $aliases $port $proto\n";
    }