blob: 416c96be21e114cb089cd6a5cd63c1f12a2f8a52 (
plain) (
tree)
|
|
#!/bin/sh
# Print a random line from argument files
if [ "$#" -eq 0 ] ; then
printf >&2 'rndl: Need at least one filename\n'
exit 1
fi
lc=$(sed -- '$=;d' "$@") || exit
ri=$(rndi 1 "$lc") || exit
sed -- "$ri"'!d' "$@"
|