36.10 Group Database Functions

Octave’s group database functions return information in a structure with the following fields.

name

The user name.

passwd

The encrypted password, if available.

gid

The numeric group id.

mem

The members of the group.

In the descriptions of the following functions, this data structure is referred to as a grp_struct.

grp_struct = getgrent ()

Return an entry from the group database, opening it if necessary.

Once the end of data has been reached, getgrent returns 0.

See also: setgrent, endgrent.

grp_struct = getgrgid (gid).

Return the first entry from the group database with the group ID gid.

If the group ID does not exist in the database, getgrgid returns 0.

See also: getgrnam.

grp_struct = getgrnam (name)

Return the first entry from the group database with the group name name.

If the group name does not exist in the database, getgrnam returns 0.

See also: getgrgid.

setgrent ()

Return the internal pointer to the beginning of the group database.

See also: getgrent, endgrent.

endgrent ()

Close the group database.

See also: getgrent, setgrent.

© 1996–2020 John W. Eaton
Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.
Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.
Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions.
https://octave.org/doc/v5.2.0/Group-Database-Functions.html