If I create the script /root/bin/whoami.sh containing:
/root/bin/whoami.sh
#!/bin/bash whoami
and this script is called by a user with a properly
Odd, the system does distinguish between real and effective UIDs, but I can find no program that exports this at shell level.