Also, will these variables always match currently logged-in username (they do on my Debian system)? Can I assume their availability in other Unix(-like) systems? I'm also curious why one would use whoami instead of just reading any of these variables.
![Who sets $USER and $USERNAME environment variables?](https://cdn-ak-scissors.b.st-hatena.com/image/square/b464c2cda694ab68f456c208dff3f30700a47c13/height=288;version=1;width=512/https%3A%2F%2Fcdn.sstatic.net%2FSites%2Funix%2FImg%2Fapple-touch-icon%402.png%3Fv%3D32fb07f7ce26)