sorting cksum output.


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers sorting cksum output.
# 1  
Old 07-04-2008
sorting cksum output.

Hi guys,

I have a service directory with a lot of files in.

I have to cksum the whole directory and compare it to a release note document.

However the problem I have is the files are listed in different lines when running cksum as they are in the release doc. Therefore cksum shows differences.

The release note cksums are in a table in a work doc. I can cut and paste to a notepad and then paste into a file using vi. It creates different white space in the fields but I get around this with diff -w.

If I have the cksums from the release notes in a file called Release_note.cksum and the output the result of cksum * to a file called directory.cksum, is there anything I can do to sort these output and save them each to another file and then diff the 2 sorted files?

Many thanks in anticipation.

Stin
# 2  
Old 07-04-2008
OK. This works:

$ cd /some /random/directory
$ find * -type f -exec cksum {}; | sort -k 3 | sed 's/\.\///' > filename

This gives the sorted cksum output into a file.

Paste the release note cksums into a file then:

$ more release_note.cksum | sort -k 3 | sed 's/\.\///' > release_note_sorted

Compare the 2 sorted files:

$ diff -w filename release_note_sorted
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sorting out unique values from output of for loop.

Hi , i have a belwo script which is used to get sectors per track value extarcted from Solaris machine: for DISK in /dev/dsk/c*t*d*s*; do value=`prtvtoc "$DISK" | sed -n -e '/Dimensions/,/Flags/{/Dimensions/d; /Flags/d; p; }' | sed -n -e '/sectors\/track/p'`; if ; then echo... (4 Replies)
Discussion started by: omkar.jadhav
4 Replies

2. Shell Programming and Scripting

Sorting output of AWK array

I need help to sort the output of an awk array Example datadata="1 blue 2 green 3 blue 4 yellow 5 blue 6 red 7 yellow 8 red 9 yellow 10 yellow 11 green 12 orange 13 black" My awk line to get output in one lineecho "$data" | awk ' {arr++; next} END { for (i in arr) { if(arr>1 )... (2 Replies)
Discussion started by: Jotne
2 Replies

3. Shell Programming and Scripting

sorting output of echo

can someone please tell me who to sort the numerical output of echo? UIO="8180 0 0 0 0 0 0 0 0 0 0 48240 48240 48240 48240 48240 48240 0 0 0 0 0 0 0 48300 0 0 0 48300" echo $UIO | sort -n This doesn't workk. it does not sort the numbers from smallest to highest. any ideas? (2 Replies)
Discussion started by: SkySmart
2 Replies

4. Shell Programming and Scripting

Sorting awk array output?

Hi all, I have a script which produces a nice table but I want to sort it on column 3. This is the output line in the script: # Output { FS = ":"; format = "%11s %6s %-16s\n"; prinft "\n" printf ( format, "Size","Count","Who" ) } for (i in... (21 Replies)
Discussion started by: Cowardly
21 Replies

5. HP-UX

Sorting top command output in HP_UX 11.11

Hello all, I've been woking on Solaris and Linux (Red Hat) so far but now I've inherited an HP-UX system and having minor issues with syntax...Appreciate if you could help me out here.. 1) I'm trying to sort the output of the top command in HP-UX 11.11 by pressing O (capital O) after typing... (2 Replies)
Discussion started by: luft
2 Replies

6. UNIX for Dummies Questions & Answers

Help Needed with Sorting Output

Hi all, I'm using Solaris 10, and need help in sorting the below output from the syslog file in descending rather than ascending order. I would like both the hostname and message columns to be sorted, but right now only the message is sorted and the count column, whose order I would like... (2 Replies)
Discussion started by: wthomas
2 Replies

7. Shell Programming and Scripting

using cksum

hi, I am trying to use the cksum feature in unix. when i make a call to it i get returned something along the lines of: 4603435 14 file3 how do i get the first part of this response only; i.e: 4603435 I'm trying to use at a way without the use of sed and creating temp... (4 Replies)
Discussion started by: leeRoberts2007
4 Replies

8. Shell Programming and Scripting

Sorting/Filed Defining/Output problem

need a little help with a few tid bits. I wrote a script that checks the resoluion of image files and writes them out to a file then sorts the resolutions by largets Width. Then take the sorted files information and toss all the 835 widths into a seperate file. Ignore the redundancies its a... (1 Reply)
Discussion started by: TiredOrangeCat
1 Replies

9. Shell Programming and Scripting

sorting output

hi, I get an output like uid=user1 gecos=user uid=user2 gecos=admin gecos=sol admin uid=user3 uid=user4 gecos=sol, admin and need it modified to: uid=user1 gecos=user (3 Replies)
Discussion started by: funksen
3 Replies
Login or Register to Ask a Question