From mboxrd@z Thu Jan 1 00:00:00 1970 From: dave@horsfall.org (Dave Horsfall) Date: Fri, 20 Oct 2017 10:25:28 +1100 (EST) Subject: [TUHS] /bin/true (was basic tools / Universal Unix) In-Reply-To: References: <009a01d348e9$e3dce200$ab96a600$@ronnatalie.com> Message-ID: On Thu, 19 Oct 2017, Ronald Natalie wrote: > /bin/maybe goes well with the motd that says “You might have mail.” I > told one of my student programmers that he could put that in the motd > and I guaranteed that within an hour someone would come in and tell me > that he checked and he didn’t have mail. Sure enough one of my senior > programmers came in and said “It said I might have mail and I didn’t > have any.” I pointed out it only said “might.” Seriously, it could be used in test scripts, to see whether a test depends implicitly upon a previous one, so if something fails it would be worthy of investigation. Usage: maybe [p] Returns "true" (0) with a probability of "p" [0.0:1.0] (default: 0.5), else "false" (1). C: exit(**argv != 't'); // Assumes "t*" or not. -- Dave Horsfall DTM (VK2KFU) "Those who don't understand security will suffer."