[Toybox] id vs whoami opinions sought

Isaac Dunham ibid.ag at gmail.com
Fri Dec 4 07:23:09 PST 2015


On Fri, Nov 27, 2015 at 01:19:33PM +1100, scsijon wrote:
> I was just wondering which is better for response and clean output format in
> a script since toybox has both available.

'whoami' is not POSIX (which is what the openbsd manpage link mentions),
but is widely available.
'id' is POSIX, and generally available.
'logname' is the POSIX equivalent to 'whoami', but it's not widely available.

whoami, logname, and id -un are all equivalent in output: the plain username
of the current user, as per /etc/passwd.

HTH,
Isaac

 1449242589.0


More information about the Toybox mailing list