Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Good afternoon fellow monks. I have been given a task of spliting my current company and old sister companies DNS. Now I have been able to make a list of company and sister company owned domains names and have a script that will perform a whois on either list, but what I would like to be able to do is grab the STDOUT from the command I run and sort each instance of the whois info for certain name servers and then from that store the domain name that the whois was ran on into theree different files (i.e. ours. theirs, and unknown ). This is where I am getting a bit confused. I have thought of using arrays to do this, but my list is large and I dont want to eat memory since this will be run on a production box. With that said can anyone point me in the best direction to do this?? Below is the current code I have to run the whois on the list I have.

Thanks all
-sunadmn
USE PERL
#!/usr/bin/perl -w # This script will run a whois on a list of domains names use strict; my $domains = '/var/tmp/clean'; my $cmd = '/usr/local/libtpp-1.32.02.redhat6/bin/tpp -c /usr/loca +l/libtpp-1.32.02.redhat6/bin/tpp.db -whois'; my $out = '/var/tmp/out_put'; open(OUT, ">$out") || die "Cant creat $out\nReason: $!\n"; open(IN, "$domains") || die "Cant open $domains to read\nReason: $!\n +"; my @domain = <IN>; close(IN); foreach my $line (@domain) { chomp $line; print "running whois on $line\n"; system "$cmd $line"; } close(OUT); exit;

In reply to Automating whois?? by sunadmn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2024-03-28 12:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found