Live data from Hacker News

Why the Unix newgrp command exists (sort of)

utcc.utoronto.ca

31–35 of 35 posts

Re: Why the Unix newgrp command exists (sort of)

#31
post #12

Earlier 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…

I believe its more that the original only had 5 char max ids. So we get fcntl and ioctl -- two different shortenings of `control` !

One of the original limits was 6 significant initial characters for extern C identifiers - even in 1980s, this was still prevalent enough that ISO C90 codified it. The easiest way to conform is to ensure that you don't have any function names longer than that. I believe this is why there are so many names like "strcpy" and "tmpnam" in the C standard library. Later additions are often not quite so laconic - e.g. it's "tmpfile", not "tmpfil".

And then many Unix shell utilities are themselves counterparts of the corresponding C APIs - e.g. "chown". It stands to reason that they'd have identical names; but in doing so, they would also set a precedent for that kind of shortening in general. So if you already have "chown", then why not "chgrp"? And if you have "chgrp", then you'd probably want "newgrp" rather than "newgroup".

Re: Why the Unix newgrp command exists (sort of)

#35

I remember years ago the behavior of groups in Solaris was quite different than in Linux or FreeBSD. Some standard functionality required running newgrp in order to be able to execute a file based on fs permissions. It was very annoying. This was 20ish years ago, so I have no idea what the behavior of now.

Ahh, Solaris. In grad school I noticed that unplugging the keyboard on our systems dropped you into a root console session. Fun.
Post reply on HN