On 01.08.2009, at 10:01, Ján ONDREJ (SAL) wrote:
On Sat, Aug 01, 2009 at 09:04:55AM +0200, Ján ONDREJ (SAL) wrote:
On Fri, Jul 31, 2009 at 09:55:39PM +0200, Alexander Graf wrote:
On 31.07.2009, at 20:19, Glauber Costa <glommer@xxxxxxxxxx> wrote:
cp "$1" "$2"
+sum=$(echo "obase=8; $sum" | bc)
printf "\\$sum" | dd of="$2" bs=1 count=1 seek=$size conv=notrunc
2>/
dev/null
May be it's better to use awk:
echo $sum | awk '{ printf("%c", $1) }' \
| dd of="$2" bs=1 count=1 seek=$size conv=notrunc 2>/dev/null
This version accepts decimal $sum, does not need conversion to octal.
Ane may be it's better to write whole checksum in awk, it's faster and
cleaner. See attached patch (I am sorry, I don't know how to use git-
email).
My awk magic is pretty bad, but I think this version is missing the
padding, right?
Alex
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html