Hi, I am new to the list, so I apologise if I do anything wrong :)

I made the script below to check files that are duplicates but I only
want to check the first few bytes (perhaps 1-10k, depending on false
positives)

I would like to convert it to native perl, can someone give me some pointers?

thanks

$ cat _md5_head.pl

#!/usr/bin/perl
# usage:
# find -type f -size +1000c -exec perl _md5_head.pl {} \; | sort -n |
uniq -w32 -D

$file = shift @ARGV;
$hash = `head -c 1000 $file | md5sum | cut -f1 -d " "`;
chomp $hash;
print $hash, "\t", $file, "\n";

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to