Here we go with the latest tests:
Ran:
sudo echo hello
Result:
hello
Ran:
alias
Result:
Last login: Wed Mar 18 14:50:14 on ttys000
Smith-iMac:~ smithjoe$ sudo echo hello
Password:
hello
Smith-iMac:~ smithjoe$ alias
Smith-iMac:~ smithjoe$
I then ran:
sudo bash
Result:
Smith-iMac:~ smithjoe$ sudo bash
bash-3.2# id
uid=0(root) gid=0(wheel) groups=0(wheel),1(daemon),2(kmem),3(sys),4(tty),5(operator),8(procview),9(procm od),12(everyone),20(staff),29(certusers),61(localaccounts),80(admin),701(com.app le.sharepoint.group.1),33(_appstore),98(_lpadmin),100(_lpoperator),204(_develope r),398(com.apple.access_screensharing),399(com.apple.access_ssh)
bash-3.2# env
SHELL=/bin/bash
TERM=xterm-256color
USER=root
SUDO_USER=smithjoe
SUDO_UID=501
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.TlpRVhfmsD/Listeners
__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0
USERNAME=root
MAIL=/var/mail/root
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
PWD=/Users/smithjoe
LANG=en_GB.UTF-8
SHLVL=1
SUDO_COMMAND=/bin/bash
HOME=/Users/smithjoe
LOGNAME=root
SUDO_GID=20
_=/usr/bin/env
bash-3.2#