in reply to Re: How to get the logged in user id
in thread How to get the logged in user id
Actually this is what I resorted to doing. The code already had getlogin() in it, but it was still returning root. I have no idea why, so I just used `tty` and `who | grep '$tty' | cut -d" " -f1`. Seems to work like a charm. ++ for you ;-)