I need to clear the screen after each iteration but i cannot place clear where it needs to go to do that. I just keep clearing the screen before i can even see the choice I make.
HWfile=~/home/daftdave/HW2
loop=y
while [ "$loop" = y ]
do
tput cup 2 15 ; echo "File Menu List"
tput cup 3 4 ; echo "L - Last Names"
tput cup 4 4 ; echo "F - First Names"
tput cup 5 4 ; echo "C - First and Last Name, sorted by city"
tput cup 6 4 ; echo "S - First and Last Name, sorted by state"
tput cup 7 4 ; echo "Q - Quit"
read choice || continue
case $choice in
[Ll]) cut -d: -f2 HW2 ;;
[Ff]) cut -d: -f1 HW2 ;;
[Cc]) sort -t: -k3 HW2 | cut -d: -f1,2 ;;
[Ss]) sort -t: -k4 HW2 | cut -d: -f1,2 ;;
[Qq]) exit ;;
*) tput cup 10 15; echo "Invalid Selection"; read choice ;;
esac
done