#!/bin/bash

find -mindepth 1 -type d | sort | while read folder ; do
   echo "$folder"
   echo ""
   thirtytwo=$(grep -rl "BOOT_IMAGE=/live/vmlinuz " $folder | wc -l)
   sixtyfour=$(grep -rl "BOOT_IMAGE=/live/vmlinuz2 " $folder | wc -l)
   total=$(($thirtytwo+$sixtyfour))
   echo "| 32-bit | $thirtytwo | $(($thirtytwo*100/$total))% |"
   echo "| 64-bit | $sixtyfour | $(($sixtyfour*100/$total))% |"
   echo ""
done
