![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| How to read terminal attributes using ioctl() | Sreejesh.S | High Level Programming | 1 | 05-17-2008 01:56 PM |
| read terminal command | munnu | High Level Programming | 6 | 01-11-2007 04:56 PM |
| How to read lock terminal values in solaris | pankajarora_12 | UNIX for Dummies Questions & Answers | 0 | 07-11-2006 10:31 AM |
| read from terminal | rein | Shell Programming and Scripting | 1 | 10-21-2005 10:43 AM |
| Terminal Hungup at the time of read | pkusumam | Shell Programming and Scripting | 1 | 11-30-2001 04:19 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
read a .bin through terminal and output a checksum?
Hi all,
Ive been given a .bin file that I want to do a checksum on to make sure that it is consistant with what I know should be the checksum. I have tried using md5sum but it spits out a 128 bit line rather than a 32 bit line, which is what I want. Can someone help set me off in the right direction to develop a tool that will allow me to read each word in the .bin and compile a checksum together? I have never used unix before and I would like explanation on what I should do. Thanks in advance for any and all help. |
|
||||
|
Hi TeamUSA.
Look at cksum, or... Perl has an excellent feature for this: String::CRC::Cksum - Perl extension for calculating checksums in a manner compatible with the POSIX cksum program. - search.cpan.org But I'm not quite sure why you want to "read each word and compile a checksum" |
|
||||
|
Hey scottn,
Thanks for sending me that. Im definitely going to take a look at it. I dont think I explained my goals. Im still new to all this so I may have stated it wrong. Basically, I want to take a file name (with the path) as an input, and I would like the output to be a computed checksum. I believe the checksum should be a 32 bit sum of all the words I have in the bin file. I'm going to see what that site gives me scottn but if anyone else has any solutions I'd be more than welcome to hear them. Thanks. |
|
||||
|
You could run it from the command line as you say, or from a script.
You can program "in the terminal" exactly as you would in a script. If your shell is /bin/ksh, for example (echo $0 to see what shell you are running), you can type ksh commands on the command line exactly as you would write them in a script. So whether you run Code:
(echo $PWD/file1; cat file1) | cksum If you're very new to this you might want to avoid Perl just for now! |
|
||||
|
haha thanks again scottn. I really want to get Perl so im hoping to stick it out. So basically, i can type (echo $PWD/file1; cat file1) | cksum in the terminal and type in the file path where you have file1? Sorry for being so new to this.
|
| Sponsored Links | ||
|
|