cat mails | tr ' ' '\n' | grep '@' | awk '{if($0 ~ /\.$/) print(substr($0,1,length($0)-1)); else print $0}'