This is the binary evaluation and conversion part of the shell script.
elif [[ $file == file[0-1][0-1][0-1][0-1][0-1][0-1][0-1][0-1] ]]
then
first=`echo $file | cut -c 5`
second=`echo $file | cut -c 6`
third=`echo $file | cut -c 7`
fourth=`echo $file | cut -c 8`
fifth=`echo $file | cut -c 9`
sixth=`echo $file | cut -c 10`
seventh=`echo $file | cut -c 11`
eighth=`echo $file | cut -c 12`
newname=file`expr $first \* 128 + $second \* 64 + $third \* 32 + $fourth \* 16 + $fifth \* 8 + $sixth \* 4 + $seventh \* 2 + $eighth \* 1` #this is converting the binary into decimal one bit at a time starting from the leftmost number
while [ ! -d CATEGORY1 ]
do
mkdir CATEGORY1
done
mv $1/$file CATEGORY1/$newname
echo "renamed - $file (now named $newname) so it has been moved to the CATEGORY1 directory."
This is what I've got, but it doesn't incorporate two's complement and I can't use built-in binary features of bash.