Simple bash program to sort and grep through a text file