Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ newgrp(1M) — SunOS 5.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

login(1)

sh(1)

intro(2)

group(4)

passwd(4)

environ(5)

newgrp(1M)

NAME

newgrp − log in to a new group

SYNOPSIS

newgrp [−] [ group ]

DESCRIPTION

newgrp logs a user into a new group by changing a user’s real and effective group ID.  The user remains logged in and the current directory is unchanged. The execution of newgrp always replaces the current shell with a new shell, even if the command terminates with an error (unknown group). 

Any variable that is not exported is reset to null or its default value.  Exported variables retain their values.  System variables (such as PS1, PS2, PATH, MAIL, and HOME), are reset to default values unless they have been exported by the system or the user.  For example, when a user has a primary prompt string (PS1) other than $ (default) and has not exported PS1, the user’s PS1 will be set to the default prompt string $, even if newgrp terminates with an error.  Note that the shell command export (see sh(1)) is the method to export variables so that they retain their assigned value when invoking new shells. 

With no arguments, newgrp changes the user’s group IDs (real and effective) back to the group specified in the user’s password file entry.  This is a way to exit the effect of an earlier newgrp command. 

If the first argument to newgrp is a −, the environment is changed to what would be expected if the user actually logged in again as a member of the new group. 

A password is demanded if the group has a password and the user is not listed in /etc/group as being a member of that group. 

ENVIRONMENT

If any of the LC_∗ variables ( LC_CTYPE, LC_MESSAGES, LC_TIME, LC_COLLATE, LC_NUMERIC, and LC_MONETARY ) (see environ(5)) are not set in the environment, the operational behavior of newgrp for each corresponding locale category is determined by the value of the LANG environment variable.  If LC_ALL is set, its contents are used to override both the LANG and the other LC_∗ variables.  If none of the above variables is set in the environment, the "C"  (U.S. style) locale determines how newgrp behaves. 

LC_CTYPE
Determines how newgrp handles characters. When LC_CTYPE is set to a valid value, newgrp can display and handle text and filenames containing valid characters for that locale.  newgrp can display and handle Extended Unix Code (EUC) characters where any individual character can be 1, 2, or 3 bytes wide.  newgrp can also handle EUC characters of 1, 2, or more column widths. In the "C" locale, only characters from ISO 8859-1 are valid. 

LC_MESSAGES
Determines how diagnostic and informative messages are presented. This includes the language and style of the messages, and the correct form of affirmative and negative responses.  In the "C" locale, the messages are presented in the default form found in the program itself (in most cases, U.S. English).

FILES

/etc/groupsystem’s group file
/etc/passwdsystem’s password file

SEE ALSO

login(1), sh(1), intro(2), group(4), passwd(4), environ(5)

SunOS 5.1  —  Last change: 5 Jul 1990

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026