Cmp is a compression script for the Audrey. It was not part of Kojak but was designed to take advantage of the compressed file system used by the Audrey. It is installed as part of the Plus pack. You can also copy the script below to /nto/bin/cmp without installing any other executables except for cut. Cmp makes use of flashlzo which is part of kojak.
Script[]
#!/bin/sh
testcmp(){
size1=`ls -l "$1" |cut -c32-44`
size2=`ls -l "/.cmp$PWD/$1" |cut -c32-44`
echo "$size1 $size2 $PWD/$1"
}
if [ "$1" == "" ] ; then
echo "usage: cmp file1 file2 file3 file4 to compress"
echo " cmp -d file1 file2 file3 file4 to decompress"
echo " cmp -c dir1 file1 dir2 file2 to test from compression"
exit
fi
if [ "$1" == "-d" ]
then
shift
until [ -z $1 ]
do
echo decompressing $1 ...
flashlzo -d "/.cmp$PWD/$1"
testcmp $1
shift
done
elif [ "$1" == "-c" ]
then
shift
echo " Original Compressed Name"
until [ -z $1 ]
do
if [ -d $1 ]
then
curd=`echo $PWD`
cd $1
for f in `ls`; do
if [ -f $f ] && [ ! -d $f ]; then
testcmp $f
fi
done
cd $curd
else
if [ -f $1 ]; then
testcmp $1
fi
fi
shift
done
else
until [ -z $1 ]
do
echo compressing $1 ...
cp "$1" "/tmp/z-$1"
flashlzo "/tmp/z-$1"
mv "/tmp/z-$1" /.cmp$PWD
mv "z-$1" "$1"
testcmp $1
shift
done
fi