summaryrefslogtreecommitdiffstats
path: root/usr.sbin/chown
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>1999-11-27 19:25:08 +0000
committerobrien <obrien@FreeBSD.org>1999-11-27 19:25:08 +0000
commit9fc872877e2cdc38e087f03f84b5fd16fa9fe726 (patch)
tree7e3d8b9e29278320c588ae031478d729880fac45 /usr.sbin/chown
parent2f018faacfb1029c34f625656e7cb95bc93e57d8 (diff)
downloadFreeBSD-src-9fc872877e2cdc38e087f03f84b5fd16fa9fe726.zip
FreeBSD-src-9fc872877e2cdc38e087f03f84b5fd16fa9fe726.tar.gz
Add "-v".
Diffstat (limited to 'usr.sbin/chown')
-rw-r--r--usr.sbin/chown/chgrp.19
-rw-r--r--usr.sbin/chown/chown.810
-rw-r--r--usr.sbin/chown/chown.c14
3 files changed, 29 insertions, 4 deletions
diff --git a/usr.sbin/chown/chgrp.1 b/usr.sbin/chown/chgrp.1
index bbba069..6852092 100644
--- a/usr.sbin/chown/chgrp.1
+++ b/usr.sbin/chown/chgrp.1
@@ -49,6 +49,7 @@
.Oc
.Op Fl f
.Op Fl h
+.Op Fl v
.Ar group
.Ar
.Sh DESCRIPTION
@@ -84,6 +85,10 @@ query about strange modes (unless the user does not have proper permissions).
.It Fl h
If the file is a symbolic link, the group ID of the link itself is changed
rather than the file that is pointed to.
+.It Fl v
+Cause
+.Nm
+to be verbose, showing files as the group is modified.
.El
.Pp
The
@@ -114,6 +119,10 @@ The
utility exits 0 on success, and >0 if an error occurs.
.Sh COMPATIBILITY
In previous versions of this system, symbolic links did not have groups.
+.Pp
+The
+.Fl v
+option is non-standard and its use in scripts is not recommended.
.Sh FILES
.Bl -tag -width /etc/group -compact
.It Pa /etc/group
diff --git a/usr.sbin/chown/chown.8 b/usr.sbin/chown/chown.8
index 4081e2b..143c774 100644
--- a/usr.sbin/chown/chown.8
+++ b/usr.sbin/chown/chown.8
@@ -46,6 +46,7 @@
.Oc
.Op Fl f
.Op Fl h
+.Op Fl v
.Ar owner Ns Op Ar :group
.Ar file ...
.Nm chown
@@ -55,6 +56,7 @@
.Oc
.Op Fl f
.Op Fl h
+.Op Fl v
.Ar :group
.Ar
.Sh DESCRIPTION
@@ -85,6 +87,10 @@ the exit status to reflect such failures.
.It Fl h
If the file is a symbolic link, change the user ID and/or the group ID
of the link itself rather than the file that the link points to.
+.It Fl v
+Cause
+.Nm
+to be verbose, showing files as the owner is modified.
.El
.Pp
The
@@ -133,6 +139,10 @@ group names may contain the dot character.
.Pp
On previous versions of this system, symbolic links did not have
owners.
+.Pp
+The
+.Fl v
+option is non-standard and its use in scripts is not recommended.
.Sh SEE ALSO
.Xr chgrp 1 ,
.Xr find 1 ,
diff --git a/usr.sbin/chown/chown.c b/usr.sbin/chown/chown.c
index e414416..4e7fea5 100644
--- a/usr.sbin/chown/chown.c
+++ b/usr.sbin/chown/chown.c
@@ -69,7 +69,7 @@ void usage __P((void));
uid_t uid;
gid_t gid;
-int Rflag, ischown, fflag, hflag;
+int Rflag, ischown, fflag, hflag, vflag;
char *gname, *myname;
int
@@ -183,11 +183,17 @@ main(argc, argv)
if (lchown(p->fts_accpath, uid, gid) && !fflag) {
chownerr(p->fts_path);
rval = 1;
+ } else {
+ if (vflag)
+ (void)printf("%s\n", p->fts_accpath);
}
} else {
if (chown(p->fts_accpath, uid, gid) && !fflag) {
chownerr(p->fts_path);
rval = 1;
+ } else {
+ if (vflag)
+ (void)printf("%s\n", p->fts_accpath);
}
}
}
@@ -266,8 +272,8 @@ void
usage()
{
(void)fprintf(stderr, "%s\n%s\n%s\n",
- "usage: chown [-R [-H | -L | -P]] [-f] [-h] owner[:group] file ...",
- " chown [-R [-H | -L | -P]] [-f] [-h] :group file ...",
- " chgrp [-R [-H | -L | -P]] [-f] [-h] group file ...");
+ "usage: chown [-R [-H | -L | -P]] [-f] [-h] [-v] owner[:group] file ...",
+ " chown [-R [-H | -L | -P]] [-f] [-h] [-v] :group file ...",
+ " chgrp [-R [-H | -L | -P]] [-f] [-h] [-v] group file ...");
exit(1);
}
OpenPOWER on IntegriCloud