list comparison


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting list comparison
# 1  
Old 11-01-2008
list comparison

what is the easy way to compare checksums of sereral paramters by script:

for example:
#im creating a file containing a list of checksum parameters
cksum /opt/LGTOaam51/data_source_types/UX_File_System/* > t1

#and another one
cksum /opt/LGTOaam51/data_source_types/UX_File_System2/* > t2

#now i want to compare the checksums of the files between t1 and t2
cheers
# 2  
Old 11-01-2008
i already tried diff which is ok but its not do you other solution other then diff
[root@trm102 root]# diff t1 t2
1,4c1,4
< 799718792 1801 /opt/LGTOaam51/data_source_types/UX_File_System/errors.txt
< 3767996894 126 /opt/LGTOaam51/data_source_types/UX_File_System/fsds
< 3752425049 10176 /opt/LGTOaam51/data_source_types/UX_File_System/fs.pl
< 1689288740 498 /opt/LGTOaam51/data_source_types/UX_File_System/unix_fs.def
---
> 55799718792 1801 /opt/LGTOaam51/data_source_types/UX_File_System/errors.txt
> 374567996894 126 /opt/LGTOaam51/data_source_types/UX_File_System/fsds
> 37526425049 10176 /opt/LGTOaam51/data_source_types/UX_File_System/fs.pl
> 1689255740 498 /opt/LGTOaam51/data_source_types/UX_File_System/unix_fs.def
[root@trm102 root]#
# 3  
Old 11-01-2008
1.what exactly do you mean when u say compare.
2. u want uniq records or duplicates?
3. is the comparision on any one field or entire line?


cat fln1 fln2 | sort | uniq -d
will concatenate both files , sort them and print duplicate records.

and if you want to compare on a particular filed u can try awk

best luck
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help about comparison

Hello folks, I have two files, which have usernames, I want to see the contents of file1.txt which is missing in file2.txt and another comparison file2.txt contents which is missing in file1.txt. please suggest. file1.txt user u2 u8 a9 p9 p3 u4 z8 aaa ahe oktlo (7 Replies)
Discussion started by: learnbash
7 Replies

2. Shell Programming and Scripting

Date Comparison

Hi Need some function or step to compare the date as given below. Example: Date_1: 25/04/2013 Date_2: 20/07/2012 if Date_1 is greater than Date_2 then do... else do.. fi Need exact unix steps to compare the above condition Use code tags please, see PM. (5 Replies)
Discussion started by: anshaa
5 Replies

3. UNIX for Dummies Questions & Answers

comparison

hi guys i need a program that can compare a value read from a com-port and one from the terminal. can somebody help me??? using linux kernel 2.6.14-M5 can only use standard function in sh and bash... (5 Replies)
Discussion started by: metal005
5 Replies

4. Shell Programming and Scripting

$((...)) and $[...] comparison

Does $((mathematical expression)) and $ mean the same? (7 Replies)
Discussion started by: proactiveaditya
7 Replies

5. Shell Programming and Scripting

Variable comparison

Can anyone help me with this section of code? The scenario is a value drops from A to B or A to C or B to C. If it drops from A to B or B to C, we print "Drop one level" If it drops from A to C, we print "Dropped two levels". The problem is script is throwing error when comparing variable... (2 Replies)
Discussion started by: sundar63
2 Replies

6. Shell Programming and Scripting

Splitting a list @list by space delimiter so i can access it by using $list[0 ..1..2]

EDIT : This is for perl @data2 = grep(/$data/, @list_now); This gives me @data2 as Printing data2 11 testzone1 running /zones/testzone1 ***-*****-****-*****-***** native shared But I really cant access data2 by its individual elements. $data2 is the entire list, while $data,2,3...... (1 Reply)
Discussion started by: shriyer
1 Replies

7. Shell Programming and Scripting

comparison of 2 files

Kindly help on follows. I have 2 files. One file contains only one column of mobile numbers. And total records in a file 12 million. Second file contains 2 columns mobile numbers and balance. and total records 30 million. I want to find out balance of each data in file 1 corresponding to file 2.... (2 Replies)
Discussion started by: kamal_418
2 Replies

8. Shell Programming and Scripting

need some help..Comparison

I need some help which would probably be for most of you a simple script. I need to read in the data from a .dat file and then compare avg to see who is the highest avg. Here is my script so far. #!/bin/ksh #reading in the data from lab3.dat filename=$1 while read name o1 o2 o3 o4 o5 o6... (0 Replies)
Discussion started by: bluesilo
0 Replies

9. UNIX for Advanced & Expert Users

Comparison List of commands

Hi, I would like to have a list of commands in a table, see below example Command description HPUNIX SUN UNIX IBM AIX all above i need comparison list of commands ASAP please.......... B.R (1 Reply)
Discussion started by: f_amshan
1 Replies

10. Filesystems, Disks and Memory

comparison

can anyone point me to a comparison of *nix file systems ? i think i prefer a journalling fs but i would like to see a comparison between several fs's before i make up my mind (2 Replies)
Discussion started by: cnf
2 Replies
Login or Register to Ask a Question