sm-grimoire AT lists.ibiblio.org
Subject: Discussion of Spells and Grimoire items
List archive
- From: Seth Woolley <seth AT tautology.org>
- To: SM-Grimoire <sm-grimoire AT lists.ibiblio.org>
- Subject: [SM-Grimoire]md5unpack script
- Date: Sun, 24 Nov 2002 14:38:53 -0800 (PST)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Wouldn't it be nice to have an md5sum-like script that did the md5s our
way?
Here it is:
==>
#!/bin/bash
. /etc/sorcery/config;for f in ${*};do echo -n $(uncompress $f \
$(guess_compressor $f)|md5sum|cut -d' ' -f1); ls -l $f|cut -c30-;done
<==
give it execute permissions, and make sure it's in your PATH and do
something like:
md5unpack /var/spool/sorcery/*
Be sure there aren't any trailing spaces after the "\", which is
supposed to escape the following newline.
same thing on more than two lines:
==>
#!/bin/bash
. /etc/sorcery/config # Get all the nice functions!
for FILE in ${*} ; do # For the files passed as arguments
echo -n $( # echo without a nl at the end the output:
uncompress $FILE $( # uncompress each one with
guess_compressor $FILE # the guessed compressor
) | # and pipe that through
md5sum | # md5sum, which is piped through
cut -d ' ' -f 1 # cut for the first space-delim. field.
) # Then,
ls -l $FILE | # list in long mode the current file, piped
cut -c 30- # to get only the size, date, and filename,
done # then end the "for" loop.
<==
"diff" the output with my md5unpack output, and you'll know what matches
and what doesn't. Useful for gurus who otherwise would do this by hand.
Seth
P.S. The code above is GPLv2, if you are wondering.
- --
Seth Alan Woolley <seth at tautology.org>, SPAM/UCE is unauthorized
Key id 7BEACC7D = 2978 0BD1 BA48 B671 C1EB 93F7 EDF4 3CDF 7BEA CC7D
Full Key at seth.tautology.org, see www.gnupg.org www.keyserver.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.0 (FreeBSD)
iD8DBQE94VUD7fQ833vqzH0RAtttAKDeT29tovJXG1fQ5DxAdVtwmc/gjQCfVoYI
qO6KZVgtyHFd8AA7cOaJ38Y=
=xUlN
-----END PGP SIGNATURE-----
- [SM-Grimoire]md5unpack script, Seth Woolley, 11/24/2002
Archive powered by MHonArc 2.6.24.