I am modifying a script that reads in a user email. It is very simple, too simple.
echo -n "Please enter your example.com email address: "
read email
email=${email%%@example.com} # removes trailing @example.com from email
echo "email is $email"
This works, but only for lower case @example.com. How could I modify this to remove the trailing @example.com, case insensitive?