Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Show 'All Files' If all file can find. Post 302964634 by alvinoo on Sunday 17th of January 2016 03:02:31 AM
Old 01-17-2016
Yes to Rudi Question.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How would I make a find command NOT show the path of a file?

When I do find . -name "*.txt" -size +0 -exec ls {} \; I get something like ./lpi_stdout.txt ./lpi_stderr.txt What would I need to do or pipe it into to strip off those first two characters so I just get lpi_stdout.txt lpi_stderr.txt ? Thanks for the help! (1 Reply)
Discussion started by: LordJezo
1 Replies

2. Shell Programming and Scripting

Want to show files on web page

hello Unix guru i want to show performance results on my internal website . We are manitaing the site through Wiki . I have to add new page in that . can someone help me to write shell script for that .. i want to display files datewise . my files names are starting with date . if... (3 Replies)
Discussion started by: deepa20
3 Replies

3. UNIX for Dummies Questions & Answers

how to use find commnad to show only path of the result

Hello all say i like to find files i do : find . -name "*.txt" but if i like to find ( and print out ) only the path's where the files are ( the *.txt files ) what can i add to the find command ? (1 Reply)
Discussion started by: umen
1 Replies

4. Shell Programming and Scripting

Show the Difference between two files

I have two files and I need to know the difference between each line. This will extend to thousand lines and manual works is really not really an option. sample: First File Second File allan entry1 entry2 entry3 allan entry1 entry3 bob entry1... (10 Replies)
Discussion started by: The One
10 Replies

5. Shell Programming and Scripting

find with file size and show the size

Hi All... is the below command be modified in sucha way that i can get the file size along with the name and path of the file the below command only gives me the file location which are more than 100000k...but I want the exact size of the file also.. find / -name "*.*" -size +100000k ... (3 Replies)
Discussion started by: rpraharaj84
3 Replies

6. Shell Programming and Scripting

Two files one file is dependent and it does not show an output

xxxxx (2 Replies)
Discussion started by: vinayrao
2 Replies

7. Shell Programming and Scripting

Show the diff in two files using awk

Hi, How can i use AWK or any other commands to find the difference between 2 files. File A aaa bbb ccc 111 222 File B aaa ccc 111 Output bbb 222 (6 Replies)
Discussion started by: gambit97
6 Replies

8. UNIX for Advanced & Expert Users

Find all files other than first two files dates & last file date for month

Hi All, I need to find all files other than first two files dates & last file date for month and month/year wise list. lets say there are following files in directory Mar 19 2012 c.txt Mar 19 2012 cc.txt Mar 21 2012 d.txt Mar 22 2012 f.txt Mar 24 2012 h.txt Mar 25 2012 w.txt Feb 12... (16 Replies)
Discussion started by: Makarand Dodmis
16 Replies

9. Shell Programming and Scripting

awk to find the avg of every 3 rows but only show last result?

Hi, I've got as far as this: awk '{sum+=$1}(NR%3==1){avg=sum/3; print avg}' input.txt Input it: 0.1 txt txt 0.2 txt txt 0.3 txt txt So, the I get the results: 0.0333333 0.133333 0.2 (8 Replies)
Discussion started by: JohnnyEnglish
8 Replies

10. UNIX for Beginners Questions & Answers

Find all .sh files in file system and need to replace the string inside .sh files

Hi All, I need to write a script to find all "*.sh" files in /home file system and if any string find "*.sh" files with the name vijay@gmail.com need to replace with vijay.bhaskar@gmail.com. I just understood about the find the command to search .sh files. Please help me on this. find / -name... (3 Replies)
Discussion started by: bhas85
3 Replies
Net::DNS(3)						User Contributed Perl Documentation					       Net::DNS(3)

NAME
Net::DNS - Perl interface to the DNS resolver SYNOPSIS
"use Net::DNS;" DESCRIPTION
Net::DNS is a collection of Perl modules that act as a Domain Name System (DNS) resolver. It allows the programmer to perform DNS queries that are beyond the capabilities of "gethostbyname" and "gethostbyaddr". The programmer should be somewhat familiar with the format of a DNS packet and its various sections. See RFC 1035 or DNS and BIND (Albitz & Liu) for details. Resolver Objects A resolver object is an instance of the "Net::DNS::Resolver" class. A program can have multiple resolver objects, each maintaining its own state information such as the nameservers to be queried, whether recursion is desired, etc. Packet Objects "Net::DNS::Resolver" queries return "Net::DNS::Packet" objects. Packet objects have five sections: o The header section, a "Net::DNS::Header" object. o The question section, a list of "Net::DNS::Question" objects. o The answer section, a list of "Net::DNS::RR" objects. o The authority section, a list of "Net::DNS::RR" objects. o The additional section, a list of "Net::DNS::RR" objects. The "Net::DNS::Update" package is a front-end to "Net::DNS::Packet" for creating packet objects to be used in dynamic updates. Header Objects "Net::DNS::Header" objects represent the header section of a DNS packet. Question Objects "Net::DNS::Question" objects represent the question section of a DNS packet. RR Objects "Net::DNS::RR" is the base class for DNS resource record (RR) objects in the answer, authority, and additional sections of a DNS packet. Don't assume that RR objects will be of the type you requested -- always check an RR object's type before calling any of its methods. METHODS
See the manual pages listed above for other class-specific methods. version print Net::DNS->version, " "; Returns the version of Net::DNS. mx # Use a default resolver -- can't get an error string this way. use Net::DNS; my @mx = mx("example.com"); # Use your own resolver object. use Net::DNS; my $res = Net::DNS::Resolver->new; my @mx = mx($res, "example.com"); Returns a list of "Net::DNS::RR::MX" objects representing the MX records for the specified name; the list will be sorted by preference. Returns an empty list if the query failed or no MX records were found. This method does not look up A records -- it only performs MX queries. See "EXAMPLES" for a more complete example. yxrrset Use this method to add an "RRset exists" prerequisite to a dynamic update packet. There are two forms, value-independent and value-depen- dent: # RRset exists (value-independent) $packet->push("pre", yxrrset("host.example.com A")); Meaning: At least one RR with the specified name and type must exist. # RRset exists (value-dependent) $packet->push("pre", yxrrset("host.example.com A 10.1.2.3")); Meaning: At least one RR with the specified name and type must exist and must have matching data. Returns a "Net::DNS::RR" object or "undef" if the object couldn't be created. nxrrset Use this method to add an "RRset does not exist" prerequisite to a dynamic update packet. $packet->push("pre", nxrrset("host.example.com A")); Meaning: No RRs with the specified name and type can exist. Returns a "Net::DNS::RR" object or "undef" if the object couldn't be created. yxdomain Use this method to add a "name is in use" prerequisite to a dynamic update packet. $packet->push("pre", yxdomain("host.example.com")); Meaning: At least one RR with the specified name must exist. Returns a "Net::DNS::RR" object or "undef" if the object couldn't be created. nxdomain Use this method to add a "name is not in use" prerequisite to a dynamic update packet. $packet->push("pre", nxdomain("host.example.com")); Meaning: No RR with the specified name can exist. Returns a "Net::DNS::RR" object or "undef" if the object couldn't be created. rr_add Use this method to add RRs to a zone. $packet->push("update", rr_add("host.example.com A 10.1.2.3")); Meaning: Add this RR to the zone. RR objects created by this method should be added to the "update" section of a dynamic update packet. The TTL defaults to 86400 seconds (24 hours) if not specified. Returns a "Net::DNS::RR" object or "undef" if the object couldn't be created. rr_del Use this method to delete RRs from a zone. There are three forms: delete an RRset, delete all RRsets, and delete an RR. # Delete an RRset. $packet->push("update", rr_del("host.example.com A")); Meaning: Delete all RRs having the specified name and type. # Delete all RRsets. $packet->push("update", rr_del("host.example.com")); Meaning: Delete all RRs having the specified name. # Delete an RR. $packet->push("update", rr_del("host.example.com A 10.1.2.3")); Meaning: Delete all RRs having the specified name, type, and data. RR objects created by this method should be added to the "update" section of a dynamic update packet. Returns a "Net::DNS::RR" object or "undef" if the object couldn't be created. EXAMPLES
The following examples show how to use the "Net::DNS" modules. See the other manual pages and the demo scripts included with the source code for additional examples. See the "Net::DNS::Update" manual page for an example of performing dynamic updates. Look up a host's addresses. use Net::DNS; my $res = Net::DNS::Resolver->new; my $query = $res->search("host.example.com"); if ($query) { foreach my $rr ($query->answer) { next unless $rr->type eq "A"; print $rr->address, " "; } } else { print "query failed: ", $res->errorstring, " "; } Find the nameservers for a domain. use Net::DNS; my $res = Net::DNS::Resolver->new; my $query = $res->query("example.com", "NS"); if ($query) { foreach $rr ($query->answer) { next unless $rr->type eq "NS"; print $rr->nsdname, " "; } } else { print "query failed: ", $res->errorstring, " "; } Find the MX records for a domain. use Net::DNS; my $name = "example.com"; my $res = Net::DNS::Resolver->new; my @mx = mx($res, $name); if (@mx) { foreach $rr (@mx) { print $rr->preference, " ", $rr->exchange, " "; } } else { print "can't find MX records for $name: ", $res->errorstring, " "; } Print a domain's SOA record in zone file format. use Net::DNS; my $res = Net::DNS::Resolver->new; my $query = $res->query("example.com", "SOA"); if ($query) { ($query->answer)[0]->print; } else { print "query failed: ", $res->errorstring, " "; } Perform a zone transfer and print all the records. use Net::DNS; my $res = Net::DNS::Resolver->new; $res->nameservers("ns.example.com"); my @zone = $res->axfr("example.com"); foreach $rr (@zone) { $rr->print; } Perform a background query and do some other work while waiting for the answer. use Net::DNS; my $res = Net::DNS::Resolver->new; my $socket = $res->bgsend("host.example.com"); until ($res->bgisready($socket)) { # do some work here while waiting for the answer # ...and some more here } my $packet = $res->bgread($socket); $packet->print; Send a background query and use select to determine when the answer has arrived. use Net::DNS; use IO::Select; my $timeout = 5; my $res = Net::DNS::Resolver->new; my $bgsock = $res->bgsend("host.example.com"); my $sel = IO::Select->new($bgsock); # Add more sockets to $sel if desired. my @ready = $sel->can_read($timeout); if (@ready) { foreach my $sock (@ready) { if ($sock == $bgsock) { my $packet = $res->bgread($bgsock); $packet->print; $bgsock = undef; } # Check for the other sockets. $sel->remove($sock); $sock = undef; } } else { print "timed out after $timeout seconds "; } BUGS
"Net::DNS" is slow. Real slow. For other items to be fixed, please see the TODO file included with the source distribution. COPYRIGHT
Copyright (c) 1997-2002 Michael Fuhr. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. AUTHOR INFORMATION
Net::DNS is currently maintained by a group, led by: Chris Reinhardt ctriv@net-dns.org Net::DNS was created by: Michael Fuhr mike@fuhr.org For more information see: http://www.net-dns.org/ SEE ALSO
perl(1), Net::DNS::Resolver, Net::DNS::Packet, Net::DNS::Update, Net::DNS::Header, Net::DNS::Question, Net::DNS::RR, RFC 1035, DNS and BIND by Paul Albitz & Cricket Liu perl v5.8.0 2002-11-17 Net::DNS(3)
All times are GMT -4. The time now is 12:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy