Get user id without forking a shell.