diff --git a/homepage/knowledge/true.html b/homepage/knowledge/true.html index f38fbad..06c5611 100644 --- a/homepage/knowledge/true.html +++ b/homepage/knowledge/true.html @@ -15,7 +15,7 @@

POSIX true(1)

-

updated 2021-08-06

+

updated 2021-08-18


true(1) is a tool that only quits silently with an exit status of 0. @@ -32,8 +32,8 @@ int main(void) { return 0; }

Because executing an empty shellscript file will in most shells do nothing and return an exit status of 0, technically an empty shellscript file is a POSIX-compliant true(1) implementation in 0 bytes. -However (TODO) it's to me unknown whether this is implementation-specific or POSIX-specified. -The usual implementation in POSIX shell is also a one-liner if you ignore the shebang: +This was the true(1) implementation on early versions of UNIX, including Research UNIX, System V, and Sun's Solaris, according to both Rob Pike and John Chambers. +A more explicit implementation also exists in POSIX shell:


 #!/bin/sh
@@ -60,8 +60,10 @@ Their true.c is 2.3 kilobytes, parses the arguments --helptrue(1) is not POSIX compliant.
 

Cited media and further reading