Format
newgrp [–l]
[group]
newgrp [–]
[group]
tcsh shell: newgrp [-] group
Description
newgrp lets
you change to a new group. You stay logged in and your working directory
does not change, but access permissions are calculated according to
your new real and effective group IDs. If an error occurs, your session
might be ended, and you must log in again.
After the group
IDs are changed, a new shell is initialized within the existing process,
effectively overlaying the current shell from which newgrp was
invoked. The new shell is determined from the initial program value
of the OMVS segment of your user profile.
newgrp does
not change the value of exported shell variables, and all others are
either set to their default or are unset.
If you did not specify
any arguments on the command line, newgrp changes
to the default group specified for your user ID in the system user
database. It also sets the list of supplementary groups to that set
in the systems group database.
If
you specify a group, newgrp changes your
real and effective group ID to that group. You are permitted to change
to that group only if your user ID is a member of that group, as specified
in the system group database.
group can
be a group name from the security facility group database, or it can
be a numeric group ID. If a numeric group exists as a group name in
the group database, the group ID number that is associated with that
group is used.
On systems where the supplementary group list
also contains the new effective group ID or where the previous effective
group ID was actually in the supplementary group list:
- If the supplementary group list also contains the new effective
group ID, newgrp changes the effective group
ID.
- If the supplementary group list does not contain the new effective
group ID, newgrp adds it to the list (if
there is room).
On systems where the supplementary group list does not normally
contain the effective group ID or where the old effective group ID
was not in the supplementary group list:
- If the supplementary group list contains the new effective group
ID, newgrp removes it from the list.
- If the supplementary group list does not contain the old effective
group ID, newgrp adds it to the list (if
there is room).
newgrp in
the tcsh shell, as in the z/OS shell, allows
you to change to a new group.
Options
- –l
- Starts the new shell session as a login session. This implies
that it can run any shell profile code.
- –
- Is the obsolete version of –l.
Localization
newgrp uses
the following localization environment variables:
- LANG
- LC_ALL
- LC_CTYPE
- LC_MESSAGES
- NLSPATH
See Localization for more
information.
Usage notes
- The RACF® profile
FILE.GROUPOWNER.SETGID in the FACILITY class sets the group of a new
file from the process creating the file instead of from the Directory
group information.
- newgrp allows you to change
your default group in case RACF list
of group checking is not enabled.
- newgrp is not supported from an address
space running multiple processes because it would cause all processes
in the address space to have their security environment changed unexpectedly.
If you are using the OMVS interface, you must be using the NOSHAREAS
parameter before you issue the newgrp command.
Also, if you are running in an environment with the _BPX_SHAREAS environment
variable set to YES, you must unset it and start a new shell before
issuing newgrp. For example:
unset _BPX_SHAREAS; sh
Exit values
If
newgrp succeeds,
its exit status is that of the shell. Otherwise, the exit status is:
- >0
- Failure because newgrp could not obtain
the proper user or group information or because it could not run the
shell, and it ends the current shell.
Portability
POSIX.2 User Portability Extension, UNIX systems.
Related information
export, fc, sh, tcsh