nv-l

loadhosts command

1998-11-12 20:38:48
Subject: loadhosts command
From: Don Davis <don-n-darla AT WORLDNET.ATT DOT NET>
To: nv-l AT lists.tivoli DOT com
Date: Thu, 12 Nov 1998 20:38:48 -0500
John,
The command is:    /usr/OV/bin/loadhosts   (with an "s")

These are several  interesting variations that I have used:
--------------------------------------------------------------------------------

These will add one node from the command line:
echo "<IP Address> <hostname>" | loadhosts -m 255.255.255.0
-- OR --
echo "<IP Address> <IP Address> | loadhosts -m 255.255.255.0

Note: The second variation above is for nodes that do not have a
hostname
--------------------------------------------------------------------------------

This will read input from any "etc/hosts-like" file:
awk  '{system("echo  "$1"   "$2" | loadhosts -m 255.255.255.0")}'
<filename>
--------------------------------------------------------------------------------

I'm sure thare are many variations, other than awk that will work here.
I just like awk.

"etc/hosts-like" means:
$1 = IP Address
$2 = hostname

Caution: If the Subnet Mask is not specified with the -m option and the
subnet that the node belongs to does not already exist, expect trouble.
The default Subnet Mask, according to the calss of the address will be
assumed. You know what happens when you assume.
Always specify the Subnet mask unless the default is known to be
correct.

=================================================
Don Davis - Consultant, Instructor
Alliance of Professionals & Consultants, Inc.
8600 Caswell Court
Raleigh, NC 27613-1100 USA    Phone: 919-847-6056
Email: Don AT apc-services DOT com
Visit our web site at http://www.apc-services.com
=================================================

<Prev in Thread] Current Thread [Next in Thread>
  • loadhosts command, Don Davis <=