randline

command module
v0.0.0-...-9a9f79d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2020 License: MIT Imports: 3 Imported by: 0

README

randline GoDoc Go Report Card

Chooses random line(s) from a file

Installation

First install Go.

If you just want to install the binary to your current directory and don't care about the source code, run

GOBIN="$(pwd)" GOPATH="$(mktemp -d)" go get github.com/carlmjohnson/randline

Screenshots

$ randline -h
randline - display random line(s) from a file

Usage:

        randline [options]

Options:
  -lines int
        number of lines to show (<1 for same as input) (default 1)
  -replace
        allow the same line to appear more than once
  -split-words
        split on words rather than lines
  -src value
        source file or URL (default stdin)

$ cat lunch.txt
Chinese
Thai
Indian
Italian

$ cat lunch.txt | randline
Chinese

$ randline -lines 0 -src lunch.txt
Indian
Chinese
Thai
Italian

$ randline -lines 5 -replace -src lunch.txt
Thai
Chinese
Indian
Chinese
Thai

$ randline -lines 10 -src /usr/share/dict/words
preponderant
overpublic
amphitheatric
centifolious
fishworm
unhealthsomeness
repercussion
Samanid
subaerial
aculeolus

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL