The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* /bin/true (was [TUHS] basic tools / Universal Unix)
@ 2017-10-19 14:52 Ron Natalie
  2017-10-19 15:01 ` Pete Wright
                   ` (4 more replies)
  0 siblings, 5 replies; 28+ messages in thread
From: Ron Natalie @ 2017-10-19 14:52 UTC (permalink / raw)


My favorite reduction to absurdity was /bin/true.   Someone decided we
needed shell commands for true and false.   Easy enough to add a script that
said "exit 0" or exit 1" as its only line.
Then someone realized that the "exit 0" in /bin true was superfluous, the
default return was 0.  /bin/true turned into an empty, yet executable, file.

Then the lawyers got involved.    We got a version of a packaged UNIX (I
think it was Interactive Systems).    Every shell script got twelve lines of
copyright/license boilerplate.     Including /bin true.
The file had nothing but useless comment in it.



^ permalink raw reply	[flat|nested] 28+ messages in thread
* [TUHS] /bin/true (was basic tools / Universal Unix)
@ 2017-10-22 23:00 Doug McIlroy
  2017-10-23  1:11 ` Dan Cross
  0 siblings, 1 reply; 28+ messages in thread
From: Doug McIlroy @ 2017-10-22 23:00 UTC (permalink / raw)


> macOS requires you to have a data section aligned to 4K, even if you
> don't use it. The resulting binary is a little over 8K; again, mostly
> zeros.

Not quite. The classic empty executable file for /bin/true works
on OS X. That is not just a clever trick;it's a natural consequence
of Kernighan's ancient prrecept: do nothing gracefully. Conceivably
the 4K data section is, too--if the page has no physical presence
until it is accessed.

Doug


^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2017-11-28 23:25 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-19 14:52 /bin/true (was [TUHS] basic tools / Universal Unix) Ron Natalie
2017-10-19 15:01 ` Pete Wright
2017-10-19 15:17   ` Chet Ramey
2017-10-19 21:23 ` Steffen Nurpmeso
2017-10-19 21:43   ` Chet Ramey
2017-10-19 23:00     ` [TUHS] /bin/true (was " Dave Horsfall
2017-10-19 23:14       ` Grant Taylor
2017-10-19 23:23         ` Lyndon Nerenberg
2017-10-19 23:27         ` Kurt H Maier
2017-10-22  4:18           ` Dave Horsfall
2017-10-20 12:10       ` Chet Ramey
2017-10-19 21:43 ` /bin/true (was [TUHS] " Dave Horsfall
2017-10-19 22:04   ` Ronald Natalie
2017-10-19 23:25     ` [TUHS] /bin/true (was " Dave Horsfall
     [not found] ` <CAEoi9W7YZ7YXUip0JTMGip3Nd0czgdjqRCMRcK2GYmDJsckuDg@mail.gmail.com>
     [not found]   ` <CAEoi9W4zdJ3+RXjK5-5rAJ6rwx_0kx6N-bn1U61=txJGyLT_mw@mail.gmail.com>
2017-10-20  1:27     ` Dan Cross
2017-10-20  1:31       ` Lyndon Nerenberg
2017-10-20  2:05         ` Ronald Natalie
2017-11-28 16:21 ` Nemo
2017-11-28 17:56   ` Warner Losh
2017-11-28 18:26     ` Dan Cross
2017-11-28 18:41       ` Warner Losh
2017-11-28 19:09         ` Dan Cross
2017-11-28 20:34           ` Clem Cole
2017-11-28 22:42           ` Ralph Corderoy
2017-11-28 18:34     ` Bakul Shah
2017-11-28 23:25     ` Ralph Corderoy
2017-10-22 23:00 Doug McIlroy
2017-10-23  1:11 ` Dan Cross

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).