/bin/true (was [TUHS] basic tools / Universal Unix)

Dave Horsfall dave at horsfall.org
Fri Oct 20 07:43:23 AEST 2017


On Thu, 19 Oct 2017, Ron Natalie wrote:

> 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.

I've also seen /bin/true and /bin/false (I've often been tempted to write 
"/bin/maybe" to introduce a little non-determinism) as *separate binaries* 
i.e. not even linked.

These days they appear to be built-ins (as I would expect).

-- 
Dave Horsfall DTM (VK2KFU)  "Those who don't understand security will suffer."


More information about the TUHS mailing list