Added README to Goertzel
[mirrors/Programs.git] / misc / gbook / rand.sh
... / ...
CommitLineData
1#!/bin/bash
2
3getline() {
4 head -n "$1" | tail -n 1;
5}
6
7randline() {
8 while read line; do echo $((len+=1)) >/dev/null; echo "$line"; done;
9 echo "$(( ($RANDOM % $len) + 1 ))" >&2;
10}
11
12
13ls | randline
This page took 0.477296 seconds and 4 git commands to generate.