Earlier quoted context omitted.
It could also eliminate a race condition.
Good point. I hadn't thought about that. With careful use of umask, chgrp, and chmod (in that order and with proper error handling), you could protect yourself, but just setting it to the right value in the first place seems simpler.
Why the Unix newgrp command exists (sort of)
21–30 of 35 posts
Re: Why the Unix newgrp command exists (sort of)
#22Earlier quoted context omitted.
Your comment reminded me of the classic Ken Thompson quote: >Ken Thompson was once asked what he would do differently if he were redesigning the UNIX system. His reply: "I'd spell creat with an e." There was definitely a mentality at this time that symbols should be short. Probably partly because of the low resolution terminals of the time, and especially teletypes but also maybe because of different practices and a…
usr stands for UNIX system resources
Home directories were originally stored in /usr, as are another user programs
“ In particular, in our own version of the system, there is a directory "/usr" which contains all user's directories, and which is stored on a relatively large, but slow moving head disk, while the othe files are on the fast but small fixed-head disk. “
Re: Why the Unix newgrp command exists (sort of)
#23Earlier quoted context omitted.
Your comment reminded me of the classic Ken Thompson quote: >Ken Thompson was once asked what he would do differently if he were redesigning the UNIX system. His reply: "I'd spell creat with an e." There was definitely a mentality at this time that symbols should be short. Probably partly because of the low resolution terminals of the time, and especially teletypes but also maybe because of different practices and a…
usr stands for UNIX system resources
Re: Why the Unix newgrp command exists (sort of)
#24The real question is: why not just suck it up and include that "ou"?
Your comment reminded me of the classic Ken Thompson quote: >Ken Thompson was once asked what he would do differently if he were redesigning the UNIX system. His reply: "I'd spell creat with an e." There was definitely a mentality at this time that symbols should be short. Probably partly because of the low resolution terminals of the time, and especially teletypes but also maybe because of different practices and a…
Re: Why the Unix newgrp command exists (sort of)
#25The real question is: why not just suck it up and include that "ou"?
Your comment reminded me of the classic Ken Thompson quote: >Ken Thompson was once asked what he would do differently if he were redesigning the UNIX system. His reply: "I'd spell creat with an e." There was definitely a mentality at this time that symbols should be short. Probably partly because of the low resolution terminals of the time, and especially teletypes but also maybe because of different practices and a…
So we get fcntl and ioctl -- two different shortenings of `control` !
Re: Why the Unix newgrp command exists (sort of)
#26The real question is: why not just suck it up and include that "ou"?
Your comment reminded me of the classic Ken Thompson quote: >Ken Thompson was once asked what he would do differently if he were redesigning the UNIX system. His reply: "I'd spell creat with an e." There was definitely a mentality at this time that symbols should be short. Probably partly because of the low resolution terminals of the time, and especially teletypes but also maybe because of different practices and a…
Re: Why the Unix newgrp command exists (sort of)
#27The real question is: why not just suck it up and include that "ou"?
Your comment reminded me of the classic Ken Thompson quote: >Ken Thompson was once asked what he would do differently if he were redesigning the UNIX system. His reply: "I'd spell creat with an e." There was definitely a mentality at this time that symbols should be short. Probably partly because of the low resolution terminals of the time, and especially teletypes but also maybe because of different practices and a…
Re: Why the Unix newgrp command exists (sort of)
#28At a previous job, I had to use newgrp quite frequently. There's a limit on the number of "active" groups you can be in at a time, typically 16. Groups were used for permissions for directories on network storage and our version control system at the time. As far as I'm aware, I was the only person at the company affected because I touched so many different repositories, I was a member of around 20 groups. I had to b…
Re: Why the Unix newgrp command exists (sort of)
#29The newgrp command also changes your primary group. This affects the gid on new files that get created (a field in the new file's inode). Try these commands: id touch a newgrp cdrom # or any group other than the first one id # note that gid is now 'cdrom', # and it's also first on the groups= list touch b ls -l a b # note different group ownership exit # leave the extra shell that newgrp created This can actually sav…
Re: Why the Unix newgrp command exists (sort of)
#30The newgrp command also changes your primary group. This affects the gid on new files that get created (a field in the new file's inode). Try these commands: id touch a newgrp cdrom # or any group other than the first one id # note that gid is now 'cdrom', # and it's also first on the groups= list touch b ls -l a b # note different group ownership exit # leave the extra shell that newgrp created This can actually sav…
Depends. On BSD systems, files inherit the directory group.