You need to double-quote the echo statement in its entirety:
echo -e "ALERT - Shell Access on:' `date` `who` '
' `whois $(who | cut -d'(' -f2 | cut -d')' -f1)`"
That will prevent wrapping of the
whois output before it is
passed to sed -- preserving all the linebreaks. The remainder of your mailx
line should be fine. One other thought. Why not just write all of the
output to a tmp file following | sed -r G > tmpfile. Then just add the
tmpfile as an attachment to mailx?
mail -s "Alert: SSH Access from `who | cut -d'(' -f2 | cut -d')'
-f1`" -a tmpfile email@example.com