Subject: Re: bug#11043: chmod - new feature - restore default mode regarding the umask value

From: Paul Eggert <[email-masked]>
Date: Tue, 27 Mar 2012 08:54:04 -0700

Here's a proposed patch to document the
already-existing feature on this point.

>From 2defd3856672bacf5c422e616625f13e3a56d9e9 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email-masked]>
Date: Tue, 27 Mar 2012 08:52:20 -0700
Subject: [PATCH] doc: add chmod examples

* doc/coreutils.texi (chmod invocation): Add examples.
---
 doc/coreutils.texi |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 835c245..da1ecc5 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -10299,6 +10299,24 @@ Recursively change permissions of directories and their contents.
 
 @exitstatus
 
+Examples:
+
+@smallexample
+# Change file permissions of FOO to be world readable
+# and user writable, with no other permissions.
+chmod 644 foo
+chmod a=r,u+w foo
+
+# Add user and group execute permissions to FOO.
+chmod +110 file
+chmod ug+x file
+
+# Set file permissions of DIR and subsidiary files to
+# be the umask default, assuming execute permissions for
+# directories and for files already executable.
+chmod -R a=,+rwX dir
+@end smallexample
+
 
 @node touch invocation
 @section @command{touch}: Change file timestamps
-- 
1.7.6.5