Source Compatibility Guide

whoami

Displays your effective user ID; whoami works even if you have used su to change your current user ID. This command is not available in the default SunOS 5.x release, although it is equivalent to id.