You may need to resort to using `tty` and the output of `who`. This will (normally) show who logged into the tty, and won't be affected by su.
In reply to Re: How to get the logged in user id
by jeffenstein
in thread How to get the logged in user id
by Matts
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |