aboutsummaryrefslogtreecommitdiff
path: root/bin/maybe
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-02-13 23:34:27 +1300
committerTom Ryder <tom@sanctum.geek.nz>2016-02-13 23:34:27 +1300
commit196a9c47f77b8bfd8b3376449d66b0be06da6d49 (patch)
tree772862a7e8cf704618ad6447d9643e159dbdf868 /bin/maybe
parentFix var declaration (diff)
downloaddotfiles-196a9c47f77b8bfd8b3376449d66b0be06da6d49.tar.gz
dotfiles-196a9c47f77b8bfd8b3376449d66b0be06da6d49.zip
A few more comments
Diffstat (limited to 'bin/maybe')
-rwxr-xr-xbin/maybe4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/maybe b/bin/maybe
index 43edac80..ede32dd2 100755
--- a/bin/maybe
+++ b/bin/maybe
@@ -65,9 +65,11 @@ if (($#)) || ! ((denom > 0)) ; then
exit 2
fi
-# Perform the test and print/exit appropriately
+# If verbose, report the probability of the test
((verbose)) && printf '%s: Testing with probability 1/%u ... \n' \
"$self" "$denom"
+
+# Perform the test and print/exit appropriately
if ((RANDOM < 32767/denom)) ; then
((verbose)) && printf '%s: %s\n' \
"$self" 'Success!'