27.1.3 Searching entries from passwd

We are meant to call these function after a call to mbfl_system_passwd_read(). The following functions inspect entries from /etc/passwd and locate them using numeric indexes; such indexes are valid only until the next call to mbfl_system_passwd_reset().

Function: mbfl_system_passwd_find_entry_by_name NAME
Function: mbfl_system_passwd_find_entry_by_name_var _RV NAME

Search the entries of passwd for one whose user name is NAME. When successful: print to stdout the index of the entry and return true; otherwise return false. We can use the index with the functions described in Inspecting entries from passwd.

The function variant _var stores the result in the variable _RV, rather than print it; Result variables.

Function: mbfl_system_passwd_find_entry_by_uid UID
Function: mbfl_system_passwd_find_entry_by_uid_var _RV UID

Search the entries of passwd for one whose user id is UID. When successful: print to stdout the index of the entry and return true; otherwise return false. We can use the index with the functions described in Inspecting entries from passwd.

The function variant _var stores the result in the variable _RV, rather than print it; Result variables.


This document describes version 3.0.0-devel.9 of Marcos Bash Functions Library.