#!/bin/bash

source ~/.gamerc

[ "$1" == "" ] && START_LINE=1 \
|| START_LINE="$(ls -tr Ctrl-*.tar.gz|grep -n "$1"|awk -F: '{print $1}')"

for((i=$START_LINE;i<=$(ls Ctrl*|wc -l);i++));do 

	A="$(ls Ctrl*|head -$(($i))|tail -1)"
	B="$(ls Ctrl*|head -$(($i+1))|tail -1)"

	rm -rf a b
	mkdir a b

	tar zxf $A -C a
	tar zxf $B -C b

	rm -f */bin/blah.txt */bin/blah.txt

	echo
	echo
	echo
	echo
	echo $A vs $B|colorize cyan

	rm -f */bin/EECtrl
	diff -p -u -r a b|highlight - "^-.*$" "^+.*$" "Only in" "^@@.*"
	echo -n "Next> "|colorize cyan blue 5
	read

done
