aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-08-01 10:52:59 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-08-01 10:52:59 +1200
commit4be76c038b78c04c2aeaf7d92fb75acef4775981 (patch)
tree55ed011a4b968a12e529215008c82335b2c01973 /bin
parentAdd rnda(1) (diff)
downloaddotfiles-4be76c038b78c04c2aeaf7d92fb75acef4775981.tar.gz
dotfiles-4be76c038b78c04c2aeaf7d92fb75acef4775981.zip
Change rndf(1) to use rnda(1)
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