The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
using cksum leeRoberts2007 Shell Programming and Scripting 4 05-31-2007 06:30 PM
Sorting/Filed Defining/Output problem TiredOrangeCat Shell Programming and Scripting 1 02-11-2007 08:41 PM
sorting output funksen Shell Programming and Scripting 3 01-09-2007 01:12 AM
Sorting problem "sort -k 16,29 sample.txt > output.txt" ganapati Shell Programming and Scripting 3 08-01-2006 02:55 AM
Sorting "ls" output on more than 1 column Nicol UNIX for Dummies Questions & Answers 1 09-20-2005 04:37 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-04-2008
Registered User
 

Join Date: Mar 2008
Posts: 27
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
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 07-04-2008
Registered User
 

Join Date: Mar 2008
Posts: 27
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
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:17 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0