bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: umask builtin


From: kalle
Subject: Re: umask builtin
Date: Wed, 08 Nov 2017 17:06:36 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.2.0


Am 08.11.2017 um 14:55 schrieb DJ Mills:
> 
> 
> On Wed, Nov 8, 2017 at 6:04 AM, kalle <address@hidden
> <mailto:address@hidden>> wrote:
> 
>     in my version 4.4.0(1),
>     `umask' gives me a numeric output of `0022',
>     while `umask -S' gives me an output of `u=rwx,g=rx,o=rx'.
>     Shouldn't umask -S also formulate the mask in a negative way, as does
>     `umask'? Thus giving out `u=,g=w,o=w'?
> 
>     greetings,
>     kalle
> 
> 
> From umask(1p):
>   For a symbolic_mode value, the new value of the file mode creation mask
>   shall be the logical complement of the file permission bits portion  of
>   the file mode specified by the symbolic_mode string.

This sentence is inacceptably complicate. Furthermore, it is not clear
which symbolic mode string is meant at the end of the sentence, but I
suppose it has been written by you to undermine the given facts.

But this existing practice of having different logics whether the mode
is presented in numeric or symbolic way  is the questionable thing..

Am 08.11.2017 um 15:01 schrieb Eduardo A. Bustamante López:
> Hm, is there a umask program that does this?
>
> Looking at the shells I have installed, they all do pretty much the same:
>
> address@hidden:~$ for sh in bash dash ksh93 mksh posh zsh; do echo $sh
$($sh -c 'echo $(umask) $(umask -S)'); done
> bash 0022 u=rwx,g=rx,o=rx
> dash 0022 u=rwx,g=rx,o=rx
> ksh93 0022 u=rwx,g=rx,o=rx
> mksh 022 u=rwx,g=rx,o=rx
> posh 022 u=rwx,g=rx,o=rx
> zsh 022 u=rwx,g=rx,o=rx
>

I did not question this...

it's just not the easiest logic to have different logics.
or is the different behavior made clear in some other documentation than
'man 1p umask'?

kalle



reply via email to

[Prev in Thread] Current Thread [Next in Thread]