gethome

Description

The gethome() function retrieves the home directory for the specified user. This information is obtained from the home directory field of /etc/passwd or the NIS password map.

Not supported in Endpoint Privilege Management for Linux (EPM-L).

Syntax

result = gethome([user]);

Arguments

user Optional. The name of the user for which home directory information should be retrieved. If this argument is not specified, then the value of the runuser variable is used.

Return Values

A string that contains the specified user’s home directory from the home directory field of /etc/password or the NIS map. If the user is not found, then result contains a blank string.

result = gethome("JSmith");

In this example, the home directory for the user JSmith is returned in result. For example, /home/JSmith.