| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | CRC32 |
-={ Friday, 30 September 2016, 03:08:50.904363019 -0700 }=-
Hey Alan!
AI> Do you happen to know if it's possible to use this utility to get
AI> a CRC-32 value for a file?
Yes. Try this;
cksum filename | cut -f1 -d' '
which will just output the checksum and trim off the byte count and filename.
AI> Example: Crc B0A29EE6
printf "Crc %x\n" $(cksum filename | cut -f1 -d' ')
However it will output without caps - Example: Crc 53a7b0cd
If that is an issue then something like this might be better;
echo "Crc $(printf "%x" $(cksum filename | cut -f1 -d' ')
| tr '[:lower:]' '[:upper:]')"
which will result in 'Crc 53A7B0CD' instead of 'Crc 53a7b0cd'. Looking at
it as a oneliner I am thinking gawk might be a better solution but then
where is the fun in that?
Life is good,
Maurice
... þa þurfon swiþe lytles, þe maran ne willniaþ þonne genoges.
They need very little who desire no more than enough.
--- GNU bash, version 4.4.0(1)-release (x86_64-atom-linux-gnu)
* Origin: Little Mikey's Brain - Ladysmith BC, Canada (1:153/7001.0)SEEN-BY: 109/500 120/544 123/5 111 140 400 500 789 1970 124/5013 5014 135/300 SEEN-BY: 138/146 140/1 153/250 757 802 7001 7715 154/0 10 30 203/0 221/0 6 SEEN-BY: 227/51 201 229/426 240/1661 249/303 261/38 266/512 275/100 280/464 SEEN-BY: 280/5003 288/34 310/31 320/119 322/759 340/200 800 342/11 77 806 SEEN-BY: 633/267 280 640/384 712/848 770/1 2320/100 3634/12 @PATH: 153/7001 7715 140/1 123/500 154/10 280/464 712/848 633/267 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.