You haven't said much about what you'd like to see. Do you want simply an indication that the files are the same or different? Do you need to know details on a line-by-line basis? Can the file content be reordered?
One could look at the lengths of the files. If they differ in length, then they cannot be the same. If the length is the same, then you could use a check-summing code, say md5sum, to calculate a numeric signature for the files, and then compare all the signatures.
If you want detailed attempts from responders here, then post some representative samples of 4 files, along with how you think the output should be displayed.
I want a soultion to compare two arrays in sh with an easy way.I want a solution to synchrose users between different AIX servers where no NIS is available. All users are meant to be same on all 10 servers. So the approach is to consider first server as master user repository and whatever the users... (0 Replies)
Team,
I have two files and I am trying to find the lines unique to file1. So i have executed the below command at shell prompt and got the correct results
comm -23 <(sort test) <(sort test1)
When i run the same command in Bash shell script, i got the correct results.
But when i run... (5 Replies)
Hi,
I have a situation to compare one file, say file1.txt with a set of files in directory.The directory contains more than 100 files.
To be more precise, the requirement is to compare the first field of file1.txt with the first field in all the files in the directory.The files in the... (10 Replies)
Hi,
I need to compare two directories and I'm using the command tar -dvf directory.tar in the directory on other machine.
I saw in the result, message like Uid, Gid, Mod time differs, etc... and it is understandable
etc/group: Uid differs
etc/group: Gid differs
etc/rc2.d/K01nrpe: Mod... (2 Replies)
Hi All,
I have written the shell script which does the following :
a. Reads the *.cnf file content from the specified input folder path
b. Grep's some strings from the *.cnf file and writes the output in result file(*.cnf_result.txt) in output folder
c. Now, if we get new version of... (5 Replies)
I want to compare two files, 1) Compare Each query result. 2) Compare Only first row of the Query output 3) Compare Time (3rd column), First file time is lesser than 2nd file then print the PO_NUM else do nothing.
File1:
C:\script>call transaction 1OPOP
C:\script>Select ID, PO_ID, TIME, DES... (3 Replies)
So I have this issue. I have 4 files. the first one is the master file who has all possible combinations:
file 1
- a
- b
- c
- d
- e
the other three have some of the letters and a number instead of - for example
file 2
34 a
5 c
file 3
10 b
12 ... (3 Replies)
Hi guys, looking for some help with a way to compare data in two files but with some conditions.
example,
File 1 consists of
site1,10.1.1.1
site2,20.2.2.2
site3,30.3.3.3
File 2 contains
site1,l0.1.1.1
site2,50.1.1.1
site3,30.3.3.3
site4,40.1.1.1
I want to be able to match the... (1 Reply)
Hello,
I have two text files, each with a single column,
file 1:
124152970
123899868
123476854
54258288
123117283
file 2:
124152970
123899868
54258288
123117283
122108330 (5 Replies)
Hi,
Below are the sample files. x.txt is from an Excel file that is a list of users from Windows and y.txt is a list of database account.
$ head -500 x.txt y.txt
==> x.txt <==
TEST01 APP_USER_PROFILE
USER03 APP_USER_PROFILE
TEST02 APP_USER_EXP_PROFILE
TEST04 APP_USER_PROFILE
USER01 ... (3 Replies)
Discussion started by: newbie_01
3 Replies
LEARN ABOUT REDHAT
ldap_compare
LDAP_COMPARE(3) Library Functions Manual LDAP_COMPARE(3)NAME
ldap_compare, ldap_compare_s - Perform an LDAP compare operation
SYNOPSIS
#include <ldap.h>
int ldap_compare_s(ld, dn, attr, value)
LDAP *ld;
char *dn, *attr, *value;
int ldap_compare(ld, dn, attr, value)
LDAP *ld;
char *dn, *attr, *value;
DESCRIPTION
The ldap_compare_s() routine is used to perform an LDAP compare operation synchronously. It takes dn, the DN of the entry upon which to
perform the compare, and attr and value, the attribute type and value to compare to those found in the entry. It returns an LDAP error
code, which will be LDAP_COMPARE_TRUE if the entry contains the attribute value and LDAP_COMPARE_FALSE if it does not. Otherwise, some
error code is returned.
The ldap_compare() routine is used to perform an LDAP compare operation asynchronously. It takes the same parameters as ldap_compare_s(),
but returns the message id of the request it initiated. The result of the compare can be obtained by a subsequent call to ldap_result(3).
ERRORS
ldap_compare_s() returns an LDAP error code which can be interpreted by calling one of ldap_perror(3) and friends. ldap_compare() returns
-1 if something went wrong initiating the request. It returns the non-negative message id of the request if things went ok.
BUGS
There is no way to compare binary values, but there should be.
SEE ALSO ldap(3), ldap_error(3)ACKNOWLEDGEMENTS
OpenLDAP is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). OpenLDAP is derived from University of Michigan
LDAP 3.3 Release.
OpenLDAP 2.0.27-Release 22 September 1998 LDAP_COMPARE(3)