News for hackers. Stuff that matters.
Re:Why an empty (executable) file is generally true in Unix by ttgurney on Thursday July 07, 2022 @01:23PM (#32016774)
A tangential question, not addressed by the article: why is "true" now implemented as a binary written in C?

As expected, the GNU version is comically large[1], but even the "suckless" version is a compiled binary[2].

I'd guess that nowadays "true" is usually a shell builtin. Are there circumstances where the actual /bin/true gets called and that the overhead of forking off a shell to run it (the empty shell script) is too much?

[1] https://git.savannah.gnu.org/cgit/coreutils.git/tree/src/tru...

[2] https://git.suckless.org/sbase/file/true.c.html

Re:Why an empty (executable) file is generally true in Unix by cratermoon on Saturday July 09, 2022 @01:23PM (#32037285)
Speculation: For times when starting a shell would be an unnecessary security risk.

Not that I can think, off the top of my head, of any real world circumstance where a program would need to execute /bin/true