Sponsored Content
Full Discussion: File compare in UNIX
Top Forums Shell Programming and Scripting File compare in UNIX Post 302956585 by rakeshtomar82 on Thursday 1st of October 2015 08:16:58 AM
Old 10-01-2015
Code:
d2xxxx@hXXX17$ cat file1
com.acc.invm:FNS_PROD [94.0.5]
com.acc.invm:FNS_TEST_DCCC_Mangment [94.1.6]
com.acc.invm:FNS_APIPlat_BDMap [100.0.9]
com.acc.invm:SendEmail [29.6.113]
com.acc.invm:SendSms [12.23.65]

d2xxxx@hXXX17$ cat file2
com.acc.invm:FNS_PROD 94.0.5
com.acc.invm:FNS_TEST_DCCC_Mangment 94.0.6
com.acc.invm:FNS_APIPlat_BDMap 100.0.10

d2xxxx@hXXX17$ /usr/bin/nawk '
> FNR==NR         {split ($2, T, ".")
>                  VN[$1]=T[1]*10000+T[2]*100+T[3]
>                  next
>                 }
>                 {split ($2, T, "[].[]")
>                  NN=T[2]*10000+T[3]*100+T[4]
>                 }
>
> !($1 in VN) ||
>  (NN > VN[$1])
>
> ' file2 file1
com.acc.invm:SendEmail [29.6.113]
com.acc.invm:SendSms [12.23.65]


Last edited by Don Cragun; 10-01-2015 at 02:54 PM.. Reason: Fix CODE tags, again!
 

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Help- Unix File Compare- Struggling

I had posted this earlier about 3 weeks ago and had recieved a response and I did sort both the files and the comm command is still not working. Can someone please assist me, I would really appreciate it. Below is what I am trying to do I need to compare File A with File B and create FILE C... (2 Replies)
Discussion started by: guiguy
2 Replies

2. Programming

compare XML/flat file with UNIX file system structure

Before i start doing something, I wanted to know whether the approach to compare XML file with UNIX file system structure. I have a pre-configured file(contains a list of paths to executables) and i need to check against the UNIX directory structure. what are the various approches should i use ? I... (6 Replies)
Discussion started by: shafi2all
6 Replies

3. Shell Programming and Scripting

Unix script to compare the two file

Hi, I want to compare two | delimited files.Awk is not working in my unix box.So plz give alternate solutions. Please see the below code: file1=$1 file2=$2 num_of_records_file1=`awk ' END { print NR } ' $file1` num_of_records_file2=`awk ' END { print NR } ' $file2` i=1 while do... (4 Replies)
Discussion started by: autosys_nm
4 Replies

4. Shell Programming and Scripting

Compare two files in UNIX

Hi, I have two files File1 Contents: abc dcf sdc File2 Contents: dcf sdc erg Now my program should return the contents existing in File1 but not in File2. In this case output shoud be "abc" as abc is not available in File 2. It should not return "erg" by saying it is... (4 Replies)
Discussion started by: forums123456
4 Replies

5. Homework & Coursework Questions

Compare to values in a file in unix

Here is sample file ===============Index 0=================== isActive=0, Input=1, Output=1, Status=1 State = Future , PRIMARY UnderCount=2 inCount=2 outCount=0 SCount=673 -- ===============Index 1=================== isActive=0, Input=1, Output=1, Status=1 ... (1 Reply)
Discussion started by: sooda
1 Replies

6. UNIX for Dummies Questions & Answers

Compare two file in UNIX

Hi, how to compare all the differences from two files in unix ? plz provide the screenshots. Thanks, Dasaradha (1 Reply)
Discussion started by: dasaradha
1 Replies

7. Shell Programming and Scripting

Compare output of UNIX command and match data to text file

I am working on an outage script and I run a command from the command line which tells me the amount of generator failures in my market. The output of this command only gives me three digits to identify the site by. I have a master list of all sites in a separate file, call it list.txt. If my... (7 Replies)
Discussion started by: jbrass
7 Replies

8. Shell Programming and Scripting

Shell script (sh file) logic to compare contents of one file with another file and output to file

Shell script logic Hi I have 2 input files like with file 1 content as (file1) "BRGTEST-242" a.txt "BRGTEST-240" a.txt "BRGTEST-219" e.txt File 2 contents as fle(2) "BRGTEST-244" a.txt "BRGTEST-244" b.txt "BRGTEST-231" c.txt "BRGTEST-231" d.txt "BRGTEST-221" e.txt I want to get... (22 Replies)
Discussion started by: pottic
22 Replies
IMP(4)							     Kernel Interfaces Manual							    IMP(4)

NAME
imp - 1822 network interface SYNOPSIS
/sys/conf/SYSTEM: NIMP count # ARPAnet IMP 1822 interface DESCRIPTION
The imp interface, as described in BBN Report 1822, provides access to an intelligent message processor normally used when participating in the Department of Defense ARPA network. The network interface communicates through a device controller, usually an ACC LH/DH or HDH or a DEC IMP-11A, with the IMP. The interface is "reliable" and "flow-controlled" by the host-IMP protocol. To configure IMP support, at least one of acc(4), css(4) or hdh(4) must be included. The count specifies the total number of IMP connec- tions. The network number on which the interface resides is specified at boot time using the SIOCSIFADDR ioctl. The host number is dis- covered through receipt of NOOP messages from the IMP. The network interface is always in one of four states: up, down, initializing, or going down. When the system is booted, the interface is marked down. If the hardware controller is successfully probed, the interface enters the initializing state and transmits three NOOP mes- sages to the IMP. It then waits for the IMP to respond with two or more NOOP messages in reply. When it receives these messages it enters the up state. The ``going down'' state is entered only when notified by the IMP of an impending shutdown. Packets may be sent through the interface only while it is in the up state. Outgoing packets are dropped with the error ENETDOWN returned to the caller if the interface is in any other state. DIAGNOSTICS
imp%d: not configured. A hardware interface could not be attached during autoconfiguration because too few IMP pseudo-devices were config- ured. imp%d: leader error. The IMP reported an error in a leader (1822 message header). This causes the interface to be reset and any packets queued up for transmission to be purged. imp%d: going down in 30 seconds. imp%d: going down for hardware PM. imp%d: going down for reload software. imp%d: going down for emergency reset. The Network Control Center (NCC) is manipulating the IMP. By convention these messages are reported to all hosts on an IMP. imp?: host %x, lost %d rfnms. The IMP had messages outstanding to the host listed, but no RFNM (Request for Next Message) messages were received from the IMP in 127 seconds. The software state for that host is reinitialized. imp%d: interface reset. The host has received an interface reset message from the IMP. imp%d: address reset to x%x (%d/%d). The host has received a NOOP message which caused it to reset its notion of its current address. The Internet address is printed in hexadecimal, with the host and IMP numbers following. This indicates that the address originally set by ifconfig(8) was incorrect, that the IMP has undergone an identity crisis, or that communication between the IMP and the host is being gar- bled. imp%d: data error. The IMP noted an error in data transmitted. The host-IMP interface is reset and the host enters the init state (await- ing NOOP messages). imp%d: interface reset. The reset process has been completed. imp%d: marked down. After receiving a "going down in 30 seconds" message, and waiting 30 seconds, the host has marked the IMP unavailable. Before packets may be sent to the IMP again, the IMP must notify the host, through a series of NOOP messages, that it is back up. imp%d: can't handle af%d. The interface was handed a message with addresses formatting in an unsuitable address family; the packet was dropped. SEE ALSO
intro(4N), inet(4F), acc(4), css(4), hdh(4), implog(8), implogd(8) 3rd Berkeley Distribution August 2, 1987 IMP(4)
All times are GMT -4. The time now is 04:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy