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