How to get actual login username when using sudo su
I’ve had the need to find out the actual username of someone logged in
and working as root (via sudo su -
) to put it into a subversion
commit message.
This quick little bash script does the trick, and just echos the username.
#!/bin/bash
PID=$$ # get PID of current …