Hacker News new | ask | show | jobs
by nathell 2669 days ago
Most trivial? Not by a long shot. What about WINVER?
1 comments

Not windows, but `true` has to take the cake for the most trivial program, the portion of my comment after the second : is a valid implementation:
GO.COM for CP/M and DOS was similarly trivial. A 0-byte program, the effect of which was to cause the previously run program (which was still in memory at 0100h) to start again.
Is true a program? I thought it was a command built into the shell.
Most shells optimize it to avoid the overhead of spawning a process for something as trivial as that. But yes, it's an actual binary even so, just in case - try `which true`.

https://www.gnu.org/software/coreutils/manual/html_node/true...

It’s /usr/bin/true on Mac, and the OpenBSD source for it is at https://github.com/openbsd/src/blob/master/usr.bin/true/true... .
I don't know what I expected.