I'm working through questions from Unix The Textbook.
I'm trying to solve the question (chapter 8, #15, page 207):
- Give a command line for setting the default access mode so that you have read, write, and execute privileges, your group has read and execute privileges, your group has read and execute permissions, and all others have no permission for a newly created executable file or directory. How would you test it to be sure that it works correctly?
My initial answer was to use umask 027, but I found that creating a new file with touch or vim never worked as expected for the execute permission as umask was applied to 666 not 777.
Since my end goal is to have a permission value of 750 it seems to me it is impossible with the umask command as any umask applied to 666 will not result in 750.
Given all the questions in this section relate to chmod and umask is the question flawed in that you can't achieve the desired goal using umask?
touchcommand if I want to modify it? I assume it is a C file somewhere. – Philip Kirkbride Jun 10 '17 at 15:03which touch– Philip Kirkbride Jun 10 '17 at 15:04touchis part of GNU coreutils. Of course your system may have its own method for distributing source (SRPMs,apt-get source, etc.) – ilkkachu Jun 10 '17 at 15:06