aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/rndf6
1 files changed, 2 insertions, 4 deletions
diff --git a/bin/rndf b/bin/rndf
index fa11e68e..6418529c 100755
--- a/bin/rndf
+++ b/bin/rndf
@@ -1,11 +1,9 @@
#!/bin/sh
-# Choose a random file from a given directory. Ignores dot files.
+# Choose a random file from a given directory using rnda(1). Ignores dot files.
dir=${1:-.}
set -- "$dir"/*
if ! [ -e "$1" ] ; then
printf >&2 'rndf: No files found in %s\n' "$dir"
exit 1
fi
-argi=$(rndi 1 "$#") || exit
-shift "$((argi-1))"
-printf '%s\n' "$1"
+exec rnda