Bash Scripting on Linux: How to query your Login Name?
In Bash, you have two variables, $USER and $LOGNAME. $LOGNAME $LOGNAME provides the primary login name of the user. This name is typically stored in the /etc/passwd file and is read by the login program during the initial session setup. It is an environment variable. $USER $USER provides the name of the current user. It is often set by the shell itself or the login manager. It is an environment variable. What is an environment variable? An environment variable is…