27.1.4 Inspecting entries from passwd

The following functions inspect entries from /etc/passwd using an index argument; we must obtain indexes with the functions described in Searching entries from passwd.

Function: mbfl_system_passwd_get_name IDX
Function: mbfl_system_passwd_get_name_var _RV IDX

Print to stdout the field name of the passwd entry at index IDX.

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

local IDX NAME

mbfl_system_passwd_read
if mbfl_system_passwd_find_entry_by_name_var IDX root
then
    if mbfl_system_passwd_get_name_var NAME $IDX
    then echo "$NAME"
    fi
fi
Function: mbfl_system_passwd_get_passwd IDX
Function: mbfl_system_passwd_get_passwd_var _RV IDX

Print to stdout the field passwd of the passwd entry at index IDX.

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

Function: mbfl_system_passwd_get_uid IDX
Function: mbfl_system_passwd_get_uid_var _RV IDX

Print to stdout the field uid of the passwd entry at index IDX.

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

Function: mbfl_system_passwd_get_gid IDX
Function: mbfl_system_passwd_get_gid_var _RV IDX

Print to stdout the field gid of the passwd entry at index IDX.

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

Function: mbfl_system_passwd_get_gecos IDX
Function: mbfl_system_passwd_get_gecos_var _RV IDX

Print to stdout the field gecos of the passwd entry at index IDX.

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

Function: mbfl_system_passwd_get_dir IDX
Function: mbfl_system_passwd_get_dir_var _RV IDX

Print to stdout the field dir of the passwd entry at index IDX.

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

Function: mbfl_system_passwd_get_shell IDX
Function: mbfl_system_passwd_get_shell_var _RV IDX

Print to stdout the field shell of the passwd entry at index IDX.

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.