GETGRNAM
Section: User Commands (1)
Updated: LOCAL
Index
Return to Main Contents
NAME
getgrnam - Group information from group name
SYNOPSIS
getgrnam
[-Iagmnpv]
[-d
char
]
[-e
char
]
[ name ... ]
DESCRIPTION
getgrnam
echoes group information given a list of possible group names.
Error messages generated from within the
getgrnam
utility are sent to stderr, not stdout, allowing the programmer to use
appropriate backquoting for this command.
If no arguments are given, the current effective group is assumed.
USAGE
Options
- -I
-
Gives information about the program.
- -a
-
Same as setting npgm flags. (a is for "all"). See below.
- -g
-
Will echo group identifier (gid).
- -n
-
Will echo group name.
- -m
-
Will echo group member list.
- -p
-
Will echo group encrypted password.
- -r
-
Will report on exceptions to standard error, for example when groups are
not found.
- -v
-
True if the command is to work in verbose mode, not suitable for
backquoting and echoing more information to standard output or standard
error.
- -d
-
The character following the option indication is used as a delimiter
between output fields. The default is ':' in line with the format of
the /etc/group file.
- -e
-
The character following the option indication is used as a delimiter
between member fields. The default is ',' in line with the format of
the /etc/group file.
- -?
-
Presents brief help text to the user. This option causes an error to
be returned as no group number is echoed.
EXAMPLE
example$ getgrnam -a
cmim::208:cmim,dtb,asd,rhs,marg,mah,sab,yxn,spl,krf,gxf
example$ getgrnam -rvgn bin nosuch ftp
getgrnam: could not find group nosuch
gname=bin:gid=2
gname=ftp:gid=204
example$ getgrnam -nm -d +
root+root,adm,ucbroot,attroot,dtb
cmim+cmim,dtb,asd,rhs,marg,mah,sab,yxn,spl,krf,gxf
example$ getgrnam -vpgn -d ,
gname=root,pass=,gid=0
DIAGNOSTICS
The following values may be returned to the calling process:
-
- 0
-
No errors noted
- 1
-
Returned when the group information is not available.
- 12
-
ENOMEM: Problem with memory.
- 22
-
EINVAL: Invalid argument supplied.
FILES
/etc/group
SEE ALSO
group(4)
getegid(2)
getgrnam(2)
getgrgid(1L)
AUTHOR
David T. Bath dtb@otto.bf.rmit.oz.au
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- USAGE
-
- Options
-
- EXAMPLE
-
- DIAGNOSTICS
-
- FILES
-
- SEE ALSO
-
- AUTHOR
-
This document was created by
man2html,
using the manual pages.
Time: 06:26:53 GMT, December 12, 2024