#!/bin/bash IFS=" " for line in $( top_sender ) do count=$( echo "$line"|awk '{print $1}' ) mail=$( echo "$line"|awk '{print $2}' ) while true do echo -n "-> $mail ($count mails) (i = inspect mail from / d = delete mail from / K = keap / q = quit ) ? " read a case $a in i) inspect_mail_from_sender "$mail" ;; d) drop_mail_from "$mail" break ;; k|"") break ;; q) exit 0 ;; *) echo "Bad choice !" esac done done