aboutsummaryrefslogblamecommitdiff
path: root/bin/rndf
blob: 6918dbea9ca8f11eeb38966f94f837613e8d375e (plain) (tree)
1
2
3
4
5
6
7
8
9
         
                                                                               





                                                    
         
#!/bin/sh
# 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
rnda "$@"