#!/bin/sh

echo "This tool attempts to categorize inode dumps by making"
echo "symbolic links from directories named after file types"
echo "to inode dumps made with dumpem.sh."
echo ""
echo "THIS IS OPEN SOURCE SOFTWARE."
echo ""
echo "Philip J. Mucci (mucci@cs.utk.edu)"
echo "http://www.cs.utk.edu/~mucci"
echo ""

for i in *
do
echo -n $i
type=`file "$i" | cut -d: -f2 | sed -e 's/^\ \ *//g'`
if [ $? -eq 0 ]; then
echo " is a $type."
if [ ! -d "$type" ]; then
echo mkdir "$type"
fi
echo ln -s "$i" "$type/$i"
fi
done
exit 0
