[PLUTO-help] un md5sum veloce e attendibile

exameron exameron a yahoo.it
Mar 6 Gen 2009 11:48:57 CET


> PS: avevo pensato addirittura di processare la prima e l'ultima parte 
> del file
> nel seguente modo...
> ################################################################
> echo $(head -c 150k nome_file ; tail -c 300k nome_file) | md5sum
> ################################################################
> ...ma non so come ficcarle nello script.



che ne pensate di questa soluzione:

#!/bin/bash
if [[ ! "${1}" ]]; then exit 0; fi
head -c 512k "$1" 2>/dev/null 1>/tmp/fastmd5_file &&
tail -c 512k "$1" 2>/dev/null 1>>/tmp/fastmd5_file &&
echo $(cat /tmp/fastmd5_file | md5sum | cut -f1 -d" ") "$1" &&
rm /tmp/fastmd5_file





More information about the pluto-help mailing list