Mercurial > ec-dotfiles
annotate bin/testcrc @ 526:f579b5310a1b
Add script to map linux ata drive numbering.
author | edogawaconan <me@myconan.net> |
---|---|
date | Sat, 09 Aug 2014 00:24:45 +0900 |
parents | 5bafb912837e |
children |
rev | line source |
---|---|
124
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
1 #!/usr/bin/perl |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
2 |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
3 use strict; |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
4 use warnings; |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
5 use String::CRC32; |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
6 |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
7 my @files = @ARGV or print("Usage u fail") && exit(1); |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
8 |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
9 foreach(@files) { |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
10 my $filename = $_; |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
11 open(FILE,$filename); |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
12 my $crc=crc32(*FILE); |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
13 close(FILE); |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
14 $crc=sprintf("%X",$crc); |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
15 print("$filename: $crc\n"); |
5bafb912837e
Massive addition of old scripts collection.
Edho Prima Arief <edho@myconan.net>
parents:
diff
changeset
|
16 } |