blob: 171188622e5e5579eaad18f45208170039d944d1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
|
#!/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
exec sed -- "$ri"'!d' "$@"
|