diff --git a/homepage/knowledge/true.html b/homepage/knowledge/true.html index 86a8730..6c12474 100644 --- a/homepage/knowledge/true.html +++ b/homepage/knowledge/true.html @@ -43,6 +43,7 @@ exit 0 This happens to be nearly identical in source to the implementation used by NetBSD.
+Python has the same 0 byte true(1)
implementation feature as most shells.
Here's false(1)
in Python rather than true(1)
to demonstrate how exiting with an arbitrary exit status can be done:
@@ -56,6 +57,8 @@ In some shells,
, from the GNU coreutils, deserves a special mention, as it's eighty lines long and directly includes four C header files. This is not a joke. Theirtrue(1)
is a shell built-in command, so runningtrue(1) true.c
is 2.3 kilobytes, parses the arguments--help
and--version
(only if either are the first argument to the program), and I don't know how big the executable ends up being because the first thing I do when I take control of a GNU system isprintf "#/bin/sh\nexit 0\n"|dd of="$(which true)";chmod +x "$(which true)"
(use at your own risk). +This implementation is not POSIX compliant. +Cited media and further reading