BSD 4_4_Lite1 release
[unix-history] / usr / src / usr.sbin / chown / chgrp.1
index 6310417..1adcb80 100644 (file)
@@ -1,4 +1,4 @@
-.\" Copyright (c) 1983, 1990, 1993
+.\" Copyright (c) 1983, 1990, 1993, 1994
 .\"    The Regents of the University of California.  All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\"    The Regents of the University of California.  All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
@@ -32,9 +32,9 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\"     @(#)chgrp.1    8.1 (Berkeley) 6/29/93
+.\"     @(#)chgrp.1    8.3 (Berkeley) 3/31/94
 .\"
 .\"
-.Dd June 29, 1993
+.Dd March 31, 1994
 .Dt CHGRP 1
 .Os BSD 4.2
 .Sh NAME
 .Dt CHGRP 1
 .Os BSD 4.2
 .Sh NAME
 .Nd change group
 .Sh SYNOPSIS
 .Nm chgrp
 .Nd change group
 .Sh SYNOPSIS
 .Nm chgrp
-.Op Fl HRfh
+.Oo
+.Fl R
+.Op Fl H | Fl L | Fl P
+.Oc
+.Op Fl f
 .Ar group
 .Ar files ...
 .Sh DESCRIPTION
 .Ar group
 .Ar files ...
 .Sh DESCRIPTION
@@ -55,50 +59,65 @@ ID specified by the group operand.
 Options:
 .Bl -tag -width Ds
 .It Fl H
 Options:
 .Bl -tag -width Ds
 .It Fl H
-When encountering a symbolic link on the command line, follow it.  All other
-symbolic links encountered in the traversal are not followed.
+If the
+.Fl R
+option is specified, symbolic links on the command line are followed.
+(Symbolic links encountered in the tree traversal are not followed.)
+.It Fl L
+If the
+.Fl R
+option is specified, all symbolic links are followed.
+.It Fl P
+If the
+.Fl R
+option is specified, no symbolic links are followed.
 .It Fl R
 .It Fl R
-Recursively change file group IDs.
-For each
-.Ar file
-operand that names a directory, chgrp changes the
-group of the directory and all files in the file
-hierarchy below it.
-When symbolic links are encountered, their group is changed,
-but they are not traversed.
+Change the group ID for the file hierarchies rooted
+in the files instead of just the files themselves.
 .It Fl f
 The force option ignores errors, except for usage errors and doesn't
 query about strange modes (unless the user does not have proper permissions).
 .It Fl f
 The force option ignores errors, except for usage errors and doesn't
 query about strange modes (unless the user does not have proper permissions).
-.It Fl h
-When encountering a symbolic link anywhere in the traversal, follow it.
 .El
 .Pp
 .El
 .Pp
-The group of a symbolic link is immutable, so unless the 
-.Fl h
-or
+Symbolic links don't have groups, so unless the 
 .Fl H
 .Fl H
-flag is set,
+or
+.Fl L
+option is set,
 .Nm chgrp
 .Nm chgrp
-on a symbolic link is a no-op.
+on a symbolic link always succeeds and has no effect.
+The
+.Fl H ,
+.Fl L
+and
+.Fl P
+options are ignored unless the
+.Fl R
+option is specified.
+In addition, these options override each other and the
+command's actions are determined by the last one specified.
 .Pp
 .Pp
-Operands:
-.Bl -tag -width group
-.It Ar group
 The
 .Ar group
 The
 .Ar group
-can be either a group name from the group database, or a numeric
-group ID.
-.It Ar file
-A pathname of a file whose group ID is to be modified.
-.El
+operand can be either a group name from the group database,
+or a numeric group ID.
+If a group name is also a numeric group ID, the operand is used as a
+group name.
 .Pp
 The user invoking
 .Pp
 The user invoking
-must belong
-to the specified group and be the owner of the file, or be the super-user.
+.Nm chgrp
+must belong to the specified group and be the owner of the file,
+or be the super-user.
 .Pp
 The
 .Nm chgrp
 utility exits 0 on success, and >0 if an error occurs.
 .Pp
 The
 .Nm chgrp
 utility exits 0 on success, and >0 if an error occurs.
+.Sh COMPATIBILITY
+Previous versions of the
+.Nm chgrp
+utility changed the group of symbolic links specified on the command
+line.
+In this system, symbolic links do not have groups.
 .Sh FILES
 .Bl -tag -width /etc/group -compact
 .It Pa /etc/group
 .Sh FILES
 .Bl -tag -width /etc/group -compact
 .It Pa /etc/group
@@ -106,13 +125,12 @@ Group ID file
 .El
 .Sh SEE ALSO
 .Xr chown 2 ,
 .El
 .Sh SEE ALSO
 .Xr chown 2 ,
-.Xr chown 8 ,
 .Xr group 5 ,
 .Xr passwd 5 ,
 .Xr fts 3 ,
 .Xr group 5 ,
 .Xr passwd 5 ,
 .Xr fts 3 ,
-.Xr symlink 7
+.Xr symlink 7 ,
+.Xr chown 8
 .Sh STANDARDS
 The
 .Nm chgrp
 utility is expected to be POSIX 1003.2 compatible.
 .Sh STANDARDS
 The
 .Nm chgrp
 utility is expected to be POSIX 1003.2 compatible.
-This manual page is derived from the POSIX 1003.2 manual page.