OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / shadow / original / man1 / newgrp.1
1 .\"$Id: newgrp.1,v 1.12 2002/03/09 19:22:30 ankry Exp $
2 .\" Copyright 1991, Julianne Frances Haugh
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\" 3. Neither the name of Julianne F. Haugh nor the names of its contributors
14 .\"    may be used to endorse or promote products derived from this software
15 .\"    without specific prior written permission.
16 .\"
17 .\" THIS SOFTWARE IS PROVIDED BY JULIE HAUGH AND CONTRIBUTORS ``AS IS'' AND
18 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 .\" ARE DISCLAIMED.  IN NO EVENT SHALL JULIE HAUGH OR CONTRIBUTORS BE LIABLE
21 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 .\" SUCH DAMAGE.
28 .TH NEWGRP 1
29 .SH NAME
30 newgrp \- log in to a new group
31 .br
32 sg \- execute command as different group ID
33 .SH SYNOPSIS
34 \fBnewgrp\fR [\fB-\fR] [\fIgroup\fR]
35 .br
36 \fBsg\fR [\fB-\fR] [\fIgroup\fR [[\fB-c\fR] \fIcommand\fR]]
37 .SH DESCRIPTION
38 \fBnewgrp\fR is used to change the current group ID during a login session.
39 If the optional \fB\-\fR flag is given, the user's environment
40 will be reinitialized as though the user had logged in, otherwise
41 the current environment, including current working directory,
42 remains unchanged.
43 .PP
44 \fBnewgrp\fR changes the current real group ID to the named group, or to the
45 default group listed in \fI/etc/passwd\fR if no group name is given. The
46 user will be prompted for a password if she do not have a password and the
47 group does, or if the user is not listed as a member and the group has a
48 password. The user will be denied access if the group password is empty and
49 the user is not listed as a member.
50 .PP
51 The \fBsg\fR command works similiar to \fBnewgrp\fR but accepts a command.
52 The command will be executed with the Bourne shell.  With most shells you
53 may run \fBsg\fR from, you need to enclose multi-word commands in quotes.
54 Another difference between \fBnewgrp\fR and \fBsg\fR is that some shells
55 treat \fBnewgrp\fR specially, replacing themselves with a new instance of
56 a shell that \fBnewgrp\fR creates.  This doesn't happen with \fBsg\fR, so
57 upon exit from a \fBsg\fR command you are returned to your previous group ID.
58 .SH FILES
59 /etc/passwd \- user account information
60 .br
61 /etc/group \- group information
62 .SH SEE ALSO
63 .BR id (1),
64 .BR login (1),
65 .BR su (1)
66 .SH AUTHOR
67 Julianne Frances Haugh <jockgrrl@ix.netcom.com>