LOGNAME
(str)Username for the current session (historic)
LOGNAME
returns the user name of the current Murex session. It’s behaviour is identical to USER
.
LOGNAME
is a historical relic. Please useUSER
in your scripts instead.
This is a reserved variable so it cannot be changed.
The $USER
and $LOGNAME
environment variables serve similar but slightly different purposes. Plus and their distinctions stem from historical and compatibility reasons.
$LOGNAME
originates from early AT&T UNIX systems and was intended to hold the user’s login name, particularly for system utilities that relied on it.
It has been part of POSIX since early UNIX specifications, which is why it is a required variable in POSIX-compliant systems.
$USER
came from BSD UNIX and was commonly used by shells and more user- focused applications. This variable has been adopted widely in modern systems like Linux to refer to the current user within shell scripts and interactive environments.Both variables typically hold the same value, representing the current user’s login name. However, in certain contexts in POSIX environments, (such as running sudo
from Bash), their behavior may differ:
$LOGNAME
is more tightly bound to the user who originally logged in,$USER
may be altered during a session.With regards to Murex, both variables call the same underlying function and thus will always return the same values under all circumstances.
$LOGNAME
and $USER
reflects the integration of features from both AT&T UNIX and BSD UNIX. Although they usually return the same value, POSIX mandates $LOGNAME
for broader system compatibility, especially with utilities that depend on login information.The reason Murex retains supports for $LOGNAME
as a reserved variable is simply to ensure nobody accidentally uses $LOGNAME
for any other purposes (such as logging) and then get confused why other utilities might break after they’ve overwritten the contents of $LOGNAME
USER
(str): Username for the current sessionstr
(string): string (primitive)This document was generated from gen/variables/LOGNAME_doc.yaml.
This site's content is rebuilt automatically from murex's source code after each merge to the master
branch. Downloadable murex binaries are also built with the website.
Last built on Wed Sep 18 21:18:57 UTC 2024 against commit c037883c03788357164e9846c84d9f777251495d9452a8e.
Current version is 6.3.4225 (develop) which has been verified against tests cases.