Index of Section 1 Manual Pages
| Interix / SUA | newgrp.1 | Interix / SUA |
newgrp(1) newgrp(1)
newgrp
NAME
newgrp - change to a new group
SYNOPSIS
newgrp [-l] group ...
DESCRIPTION
The newgrp(1) utility changes the shell execution environment to have the
specified real and effective group. This new shell environment keeps the
working directory, file creation mask, and exported variables of the
previous environment. Even if the newgrp(1) fails to assign a new group,
it still creates a new shell environment.
newgrp(1) takes the following options:
-l
Change back to the login environment; that is, the environment the
user gets when logging in.
The group is the name or numeric group identifier (ID) of a group in the
group database. If you do not specify a group, newgrp(1) changes the real
and effective group ID back to your login group.
If you are not listed as a member of the group and the group requires a
password, you are prompted to enter the password. If you are listed as a
member of the group, you are not prompted.
DIAGNOSTICS
If it succeeds, the exit status is the exit status of the shell.
Otherwise, it returns a value >0.
NOTES
By default, Interix does not execute files with the set-user-ID (setuid)
or set-group-ID (setgid) mode bit set for security reasons. If an attempt
is made to execute such a file, the ENOSETUID error is returned. For more
information and and instructions for enabling execution of files with
these mode bits set, see The superuser account and appropriate privileges
in Windows Services for UNIX Help.
Because of the security mechanisms of Windows, there is no way to get the
appropriate permissions to change groups. Therefore, this command always
fails to change the effective group. It does, however, create a new shell
environment, as described above.
SEE ALSO
sh(1)