SUNWcsu
(umask 002) nohup umask ... find . -exec umask ...it does not affect the file mode creation mask of the caller’s environment.
If the mask operand is not specified, the umask utility writes the value of the invoking process’s file mode creation mask to standard output.
The default output style is unspecified, but will be recognised on a subsequent invocation of umask on the same system as a mask operand to restore the previous file mode creation mask.
For a symbolic_mode value, the new value of the file mode creation mask is the logical complement of the file permission bits portion of the file mode specified by the symbolic_mode string.
In a symbolic_mode value, the permissions op characters + and - are interpreted relative to the current file mode creation mask; + causes the of for the indicated permissions to be cleared in the mask; - causes the bits of the indicated permissions to be set in the mask.
The interpretation of mode values that specify file mode bits other than the file permission bits is unspecified.
The file mode creation mask is set to the resulting numeric value.
The default output of a prior invocation of umask on the same system with no operand will also be recognized as a mask operand. The use of an operand obtained in this way is not obsolescent, even if it is an octal number.
If -S is specified, the message will be in the following format:
"u=%s,g=%s,o=%s\n", <owner permissions>, <group permissions>, <other permissions>where the three values will be combinations of letters from the set {r, w, x}; the presence of a letter will indicate that the corresponding bit is clear in the file mode creation mask.
If a mask operand is specified, there will be no output written to standard output.
umask a=rx,ug+w umask 002sets the mode mask so that subsequently created files have their S_IWOTH bit cleared.
After setting the mode mask with either of the above commands,
the umask command can be used to write the current value of the mode mask:
$ umask
0002
(The output format is unspecified, but historical implementations use
the obsolescent octal integer mode format.)
$ umask -S
u=rwx,g=rwx,o=rxr1
Either of these outputs can be used as the mask operand to a subsequent invocation of the umask utility.
Assuming the mode mask is set as above,
the command:
umask g-w
sets the mode mask so that subsequently created files have their S_IWGRP,
and S_IWOTH
bits cleared.
The command:
umask -- -w
sets the mode mask so that subsequently created files have all their write
bits cleared. Note that mask operands r , w , x or anything beginning with
a hyphen, must be preceded by -- to keep it from being interpreted as an
option.