I am writing a program in Bash that needs to get the user\'s username.
I have heard of a thing called whoami, but I have no idea what it does or how to use it.
W
Get the current task's user_struct
#define get_current_user() \ ({ \ struct user_struct *__u; \ const struct cred *__cred; \ __cred = current_cred(); \ __u = get_uid(__cred->user); \ __u; \ })