02-06-2012
Hi ahamad ,
thnaks for your reply.
But how do i write answer in third file.?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi there,
I have written a script called "compare" (see below) to make comparison between 2 files namely test_put.log and Output_A0.log
#!/bin/ksh
while read file
do
found="no"
while read line
do
echo $line | grep $file > /dev/null
if
then
echo $file found
found="yes"
break
fi... (3 Replies)
Discussion started by: lweegp
3 Replies
2. UNIX for Dummies Questions & Answers
I have 2 files. The first file contains user names in one column. The second, and considerably longer, file contains user names in the first column and corresponding full names in the second column. Currently these are in the .xls format. I'd like to be able to compare file1 with file2 and extract... (2 Replies)
Discussion started by: raptrmastr
2 Replies
3. Shell Programming and Scripting
Hiiiii friends
I have 2 files which contains huge data & few lines of it are as shown below
File1: b.dat(which has 21 columns)
SSR 1976 8 12 13 10 44.00 39.0700 70.7800 7.0 0 0.00 0 2.78 0.00 0.00 0 0.00 2.78 0 NULL
ISC 1976 8 12 22 32 37.39 36.2942 70.7338... (6 Replies)
Discussion started by: reva
6 Replies
4. Shell Programming and Scripting
I have a control file which tells me which are the fields in the files I need to compare and based on the values I need to print the exact value if key =Y and output is Y , or if output is Y/N then I need to print only Y if it matches or N if it does not match and if output =N , then skip the feild... (7 Replies)
Discussion started by: newtoawk
7 Replies
5. Shell Programming and Scripting
I have 2 zip files which have about 20 million records in each file. file 2 will have additional records than file 1. I want to compare the records in both the files and capture the new records from file 2 into another file file3. Please help me with a command/script which provides me the desired... (8 Replies)
Discussion started by: koneru
8 Replies
6. Shell Programming and Scripting
hi
my problem is little complicated one. i have 2 files which appear like this
file 1
abbsss:aa:22:34:as akl abc 1234
mkilll:as:ss:23:qs asc abc 0987
mlopii:cd:wq:24:as asd abc 7866
file2
lkoaa:as:24:32:sa alk abc 3245
lkmo:as:34:43:qs qsa abc 0987
kloia:ds:45:56:sa acq abc 7805
i... (5 Replies)
Discussion started by: anurupa777
5 Replies
7. Shell Programming and Scripting
Hi,
I need to compare the two floating or integer numbers which present in two different files,
Ex:
File 1:
col1 col2 col3
11 ssa 13.60
12 ssb 11.00
13 ssc 754.00
File 2:col1 col2 col3
11 sa 12.75
12 sb 11.00
13 sc 763.00
here i have to compare 3 column if 1st column match,... (8 Replies)
Discussion started by: Shenbaga.d
8 Replies
8. Shell Programming and Scripting
Hi Guys,
I wanted to compare a delimited file and positional file, for a particular key files and if it matches then append the positional file with some data.
Example:
Delimited File
--------------
Byer;Amy;NONE1;A5218257;E5218257
Byer;Amy;NONE1;A5218260;E5218260
Positional File... (3 Replies)
Discussion started by: Ajay Venkatesan
3 Replies
9. UNIX for Beginners Questions & Answers
Hello there.
I am trying to compare two files.
File1
Austria Mobile 1
United Kingdom Mobile 1
...
File2
Austria Mobile Vien 2
Austria Mobile Ostr 0
United Kingdom Mobile Dev 0.7
United Kingdom Mobile OST 1.5
What i want to do is to compare both files and... (12 Replies)
Discussion started by: dragonfly85
12 Replies
10. Shell Programming and Scripting
file2 content
f1file2 content
f1,1,2,3,4,5
f1,2,4,6,8,10
f10,1,2,3,4,5
f10,2,4,6,8,10
f5,1,2,3,4,5
f5,2,4,6,8,10awk 'FNR==NR{a;next}; !($1 in a)' file2 file1output
f10,1,2,3,4,5
f10,2,4,6,8,10
f5,1,2,3,4,5
f5,2,4,6,8,10awk 'FNR==NR{a;next}; ($1 in a)' file2 file1output
nothing... (4 Replies)
Discussion started by: gksenthilkumar
4 Replies
LEARN ABOUT CENTOS
ldns-testns
ldns-testns(1) General Commands Manual ldns-testns(1)
NAME
ldns-testns - simple fake nameserver tool
SYNOPSYS
ldns-testns [ OPTION ] datafile
DESCRIPTION
ldns-testns can be used to provide answers to DNS queries for testing. The answers are premade, and can be tailored to testing needs. The
answers can be wildly invalid or unparseable.
This program is a debugging aid. It is not efficient, especially with a long config file, but it can give any reply to any query. This can
help the developer pre-script replies for queries.
It listens to IP4 UDP and TCP by default. You can specify a packet RR by RR with header flags to return.
ldns-testns is not meant for production use.
OPTIONS
-r Listens to a random port. The port number is printed to stdout.
-p port
Listens to the specified port.
-f num Forks this number of additional instances that serve the same ports and same datafile. They do not exit; printed is 'forked pid:
<num>' and you have to kill them yourself.
-v Outputs more debug information. It is possible to give this option multiple times to increase verbosity level.
-6 Bind to IP6 address instead of IP4. Use together with -p.
datafile
The data file is read on start up. It contains queries and the packets that should be sent in answer to those queries. The data file
format is explained below.
DATA FILE FORMAT
The data file format has ';' to denote comment. A number of entries are processed first to last. The first matching entry is used to answer
the query with. This is a line based format. DNS resource records are entered in zone-file format.
You can use $ORIGIN and $TTL directives. Zone file '(' and ')' to span multiple lines are not allowed.
$ORIGIN origin $TTL default_ttl
ENTRY_BEGIN
; first give MATCH lines, that say what queries are matched ; by this entry. ; 'opcode' makes the query match the opcode from the reply ;
if you leave it out, any opcode matches this entry. ; 'qtype' makes the query match the qtype from the reply ; 'qname' makes the query
match the qname from the reply ; 'serial=1023' makes the query match if ixfr serial is 1023.
MATCH [opcode] [qtype] [qname] [serial=<value>] MATCH [UDP|TCP] MATCH ...
; Then the REPLY header is specified.
REPLY opcode, rcode or flags.
(opcode) QUERY IQUERY STATUS NOTIFY UPDATE
(rcode) NOERROR FORMERR SERVFAIL NXDOMAIN NOTIMPL YXDOMAIN
YXRRSET NXRRSET NOTAUTH NOTZONE
(flags) QR AA TC RD CD RA AD
REPLY ...
; any additional actions to do.
ADJUST copy_id ; 'copy_id' copies the ID from the query to the answer.
; 'sleep=10' sleeps for 10 seconds before giving the answer (TCP is open)
ADJUST [sleep=<num>] ; sleep before giving any reply ADJUST [packet_sleep=<num>] ; sleep before this packet in sequence
SECTION QUESTION <RRs, one per line> ; the RRcount is determined automatically.
SECTION ANSWER <RRs, one per line>
SECTION AUTHORITY <RRs, one per line>
SECTION ADDITIONAL <RRs, one per line>
EXTRA_PACKET ; follow with SECTION, REPLY for more packets. HEX_ANSWER_BEGIN ; follow with hex data
; this replaces any answer packet constructed
; with the SECTION keywords (only SECTION QUERY
; is used to match queries). If the data cannot
; be parsed, ADJUST rules for the answer packet
; are ignored
HEX_ANSWER_END
ENTRY_END
AUTHOR
Written by the ldns team as an example for ldns usage, and for testing purposes.
REPORTING BUGS
Report bugs to <ldns-team@nlnetlabs.nl>.
COPYRIGHT
Copyright (C) 2006-2008 NLnet Labs. This is free software. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
14 Dec 2006 ldns-testns(1)