Cksum file1 confusion


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Cksum file1 confusion
# 1  
Old 07-06-2009
Cksum file1 confusion

Hi all,

I'm currently trying to write a script that will input a .bin file (including file path) and output a computed checksum. My knowledge on checksums are not very good but I know that it should be a 32 bit sum of all the words in the file. If anyone can provide me any assistance, it would be greatly appreciated.
# 2  
Old 07-06-2009
Checksums verify the byte-by-byte content of files. Some are considered better than others.

You should use an already written routine, commonly available checksum or hashing command line utilities:
cksum
md5
# 3  
Old 07-06-2009
I've been using both cksum and md5 and neither will output the checksum that i want. I am quite positive that the file is correct, but these checksums do not match.
# 4  
Old 07-06-2009
Hi.

When you say "the checksums don't match", what do you mean?

They don't match with what?

Different checksum programs use different algorithms.

Where did you get the original checksum from?
# 5  
Old 07-06-2009
I think this is a homework problem.

Basically, it seems the user (seemingly a student) has been given an assignment to write a checksum with a script.

If this was not a homework problem, the poster would be describing the hash function they are using for the checksum, etc.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk to search field2 in file2 using range of fields file1 and using match to another field in file1

I am trying to use awk to find all the $2 values in file2 which is ~30MB and tab-delimited, that are between $2 and $3 in file1 which is ~2GB and tab-delimited. I have just found out that I need to use $1 and $2 and $3 from file1 and $1 and $2of file2 must match $1 of file1 and be in the range... (6 Replies)
Discussion started by: cmccabe
6 Replies

2. UNIX for Dummies Questions & Answers

Compare file1 and file2, print matching lines in same order as file1

I want to print only the lines in file2 that match file1, in the same order as they appear in file 1 file1 file2 desired output: I'm getting the lines to match awk 'FNR==NR {a++}; FNR!=NR && a' file1 file2 but they are in sorted order, which is not what I want: Can anyone... (4 Replies)
Discussion started by: pathunkathunk
4 Replies

3. UNIX for Dummies Questions & Answers

if matching strings in file1 and file2, add column from file1 to file2

I have very limited coding skills but I'm wondering if someone could help me with this. There are many threads about matching strings in two files, but I have no idea how to add a column from one file to another based on a matching string. I'm looking to match column1 in file1 to the number... (3 Replies)
Discussion started by: pathunkathunk
3 Replies

4. Solaris

cat file1 > file1

I have file1 with the contents this is file1 when i do cat file1 , the output is this is file1 when i run cat file1 > file1 , I receive the following message cat: input file1 is output (3 Replies)
Discussion started by: asalman.qazi
3 Replies

5. Shell Programming and Scripting

EEPROM CKSUM? what is this?

Hi all, So I have a binary file and I need to generate an expected EEPROM checksum for it. Ideally, I would like to input the file (with the path) and output a computed checksum. Ive been using (cksum file1) with no avail and I was just curious as to whether there is such thing as EEPROM cksum,... (1 Reply)
Discussion started by: TeamUSA
1 Replies

6. UNIX for Advanced & Expert Users

Cksum dependencies

Hi, On what factors does the cksum depend. If i build 2 machines exactly the same, then can i get the checksum of 2 compiled files same. Thanks (3 Replies)
Discussion started by: vibhor_agarwali
3 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

The cksum Problem

Hi, I have a working script, well it works on my machine but when I try it on others the cksum section does not work properly (I know the scripting is not of a high quality but I'm just trying to get it working) Heres the script: #!/bin/sh case $# in 0) echo "usage: enshar filename... (7 Replies)
Discussion started by: Dim-Wit
7 Replies

9. Shell Programming and Scripting

cksum question

Hi there, I have a query about cksum. I'm running a script on the Unix box and in a script the cksum result differs from when I run it manually. As far as I can see the file is not being changed, is there any other times that the cksum would be different. (4 Replies)
Discussion started by: rjsha1
4 Replies
Login or Register to Ask a Question