Crazy shell scripting

Not quite a mapreduce implementation , but nevertheless … while read l; do echo “SELECT id, email FROM tblName WHERE email=’$l’ ORDER by id DESC LIMIT 1;”|mysql -u root dbName; done < /tmp/dupes3.txt |grep -v ’email’|cut -f1|sed ‘s/^\(.*\)$/DELETE FROM tblName WHERE id=\1;/g’ > /tmp/deletedupes3.sql Tweet