Sponsored Content
Top Forums Shell Programming and Scripting Trying to use diff output to compare to a separate file Post 303005430 by RudiC on Wednesday 18th of October 2017 04:44:10 AM
Old 10-18-2017
Unfortunately, there's a small logical flaw in above; the sequence of files and thus how the arrays are populated DOES matter. Try
Code:
awk '
       FILENAME=="b" {arr[$0]++; next}
       FILENAME=="a" {if( !arr[$0] ) srch[$0]++}
       FILENAME=="c" {if(srch[$2]) print}
      '  b a c
test test.rpm


EDIT: How about
Code:
grep $(diff -y -b --suppress-common-lines a b | cut -f1) c
test test.rpm

This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

diff 2 files; output diff's to 3rd file

Hello, I want to compare two files. All records in file 2 that are not in file 1 should be output to file 3. For example: file 1 123 1234 123456 file 2 123 2345 23456 file 3 should have 2345 23456 I have looked at diff, bdiff, cmp, comm, diff3 without any luck! (2 Replies)
Discussion started by: blt123
2 Replies

2. Shell Programming and Scripting

compare two .dat files and if there is any difference pulled into a separate file

Hi, compare two .dat files and difference will be moved into separate file.if anybody having code for this please send asap. using diff command, i don't know how to write shell programming. and my first file is like this including Header and trailer 10Ç20060323Ç01(Header) 01ÇIÇbabuÇ3000 01ÇIÇbaluÇ4000... (1 Reply)
Discussion started by: kirankumar
1 Replies

3. UNIX for Advanced & Expert Users

File Compare and Create New File with Diff

I need to compare File A with File B and create FILE C with the difference record only. What I mean is File A has 3 records and File B has 4 records, so FILE C will only have 1 record (becuase that record is in FILE B and not in File A). Hope I am making sense. The data layout is that each data... (7 Replies)
Discussion started by: guiguy
7 Replies

4. Shell Programming and Scripting

Compare two files and output diff to third file

I have made several attempts to read two files of ip addresses and eliminate records from file1 that are in file2. My latest attempt follows. Everything works except my file3 is exactly the same as file1 and it should not be. # !/usr/bin/bash # # NoInterfaces # Utility will create a file... (8 Replies)
Discussion started by: altamaha
8 Replies

5. Shell Programming and Scripting

Compare file timestamp with current date. Diff must be 1 hour.

Hello, I've created the script below to compare the content of two files with a delay of an hour. After an hour, the lines that exist in both files, will be printed and executed. The script now uses a counter to countdown 50 minutes. But what I would prefer is to check the file timestamp of... (3 Replies)
Discussion started by: taipan
3 Replies

6. Shell Programming and Scripting

awk to compare diff output by fields

Diff output as follows: < AAA BBB CCC DDD EEE 123 > PPP QQQ RRR SSS TTT 111 > VVV WWW XXX YYY ZZZ 333 > AAA BBB CCC DDD EEE 124 How can i use awk to compare the last field to determine if the counter has increased, and need to ensure that the first 4 fields must have the same... (15 Replies)
Discussion started by: ux4me
15 Replies

7. Shell Programming and Scripting

using diff to on two file but ignoring the last comma separate value

Hi guys I have two file which I sdiff. ie file 1: AA,12,34,56,,789,101,,6666 file 2: AA,12,34,56,,789,101,,7777 The last comma separated value will always change from one day to the next. Is there another unix utility I can use that will sdiff two files but ignore the last comma... (1 Reply)
Discussion started by: wny201
1 Replies

8. Shell Programming and Scripting

compare 2 CSV fields from same diff output

Attached is a file called diff.txt It is the output from this command: diff -y --suppress-common-lines --width=5000 1.txt 2.txt > diff.txt I have also attached 1.txt and 2.txt for your convenience. Both 1.txt and 2.txt contain one very long CSV string. File 1.txt is a CSV dump of... (0 Replies)
Discussion started by: gvolpini
0 Replies

9. Shell Programming and Scripting

Compare large file and identify difference in separate file

I have a very large system generated file containing around 500K rows size 100MB like following HOME|ALICE STREET|3||NEW LISTING HOME|NEWPORT STREET|1||NEW LISTING HOME|KING STREET|5||NEW LISTING HOME|WINSOME AVENUE|4||MODIFICATION CAR|TOYOTA|4||NEW LISTING CAR|FORD|4||NEW... (9 Replies)
Discussion started by: jubaier
9 Replies

10. Shell Programming and Scripting

Compare two string in two separate file and delete some line of file

Hi all i want to write program with shell script that able compare two file content and if one of lines of file have # at the first of string or nothing find same string in one of two file . remove the line in second file that have not the string in first file. for example: file... (2 Replies)
Discussion started by: saleh67
2 Replies
gnunet-transport(1)					      General Commands Manual					       gnunet-transport(1)

NAME
gnunet-transport - measure and control the transport subsystem SYNOPSIS
gnunet-transport [OPTIONS] DESCRIPTION
gnunet-transport is a tool to access various functions of GNUnet's transport subsystem from the command-line. Most of these are not expected to be useful for end-users. gnunet-transport can be used to evaluate the performance of the transports, force a peer to connect to another peer (if possible). Other functions should be added in the near future. -b, --benchmark measure how fast we are receiving data (from all connections). On exit, the data rate will be reported. Runs until aborted with CTRL-C. -c FILENAME, --config=FILENAME configuration file to use -C PEER, --connect=PEER peer to connect to (and to use for sending if used in conjunction with -s) -h, --help print help page -i, --information print information about our current connections (once) -m, --monitor print information about our current connections (continuously) -L LOGLEVEL, --loglevel=LOGLEVEL Change the loglevel. Possible values for LOGLEVEL are ERROR, WARNING, INFO and DEBUG. -s, --send transmit (dummy) traffic as quickly as possible to the peer specified with the -C option. The rate will still be limited by the quota(s) determined by the peers (ATS subsystem). Will run until CTRL-C is pressed or until the connection to the other peer is disrupted. -t, --test test transport configuration. With this flag, the tool will check if each of the configured transport plugins has a working address. Plugins that do not have a listen port configured will be ignored. The test is performed with the help of an external server (by default running on gnunet.org) which tries to contact the local machine. The test can only work if the local GNUnet peer is not yet running. -v, --version print the version number -V, --verbose be verbose NOTES
REPORTING BUGS
Report bugs by using mantis <https://gnunet.org/bugs/> or by sending electronic mail to <gnunet-developers@gnu.org> SEE ALSO
gnunet-arm(1) GNUnet 26 Oct 2011 gnunet-transport(1)
All times are GMT -4. The time now is 08:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy