goreutils

package module
v0.0.0-...-52af73d Latest Latest
Warning

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

Go to latest
Published: May 10, 2015 License: GPL-3.0 Imports: 11 Imported by: 0

README

goreutils: Implementation of the GNU Coreutils in Go

GoDoc

Description

goreutils is an implementation of the GNU Coreutils in Go.

Download and install

As with any regular Go project, you can download, compile and install goreutils by typing the command:

$ go get github.com/cd1/goreutils

Make sure the variable GOPATH is correctly set.

goreutils should work on any system which the Go compiler can compile to (e.g. Linux, MS Windows, Mac OS X).

License

This project is licensed under the GNU GPLv3.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Arch

func Arch() string

Arch prints the machine hardware name.

func Basename

func Basename(path, suffix string) string

Basename strips directory and suffix from filenames.

func Cat

func Cat(inputs []io.Reader, out io.Writer, showTabs, number, numberNonBlank, showEnds bool) error

Cat concatenates files and prints on an io.Reader.

func Dirname

func Dirname(path string) string

Dirname strips last component from file name.

func Echo

func Echo(str string) string

Echo returns the exact same line of text.

func Mkdir

func Mkdir(name string, mode os.FileMode, createParents bool) error

Mkdir makes directories. If "createParents" is set, any parent directories are also created and no error is reported if a directory exists

func Sleep

func Sleep(duration time.Duration)

Sleep delays for a specified amount of time.

func Tee

func Tee(in io.Reader, out []io.Writer) error

Tee reads from one input and writes to multiple outputs.

func Whoami

func Whoami() (string, error)

Whoami returns the effective userid.

func Yes

func Yes(str string) <-chan string

Yes creates a channel which outputs a string indefinitely.

Types

type WcResult

type WcResult struct {
	Lines         int
	Words         int
	Chars         int
	Bytes         int
	MaxLineLength int
}

WcResult contains the result data of the function "Wc".

func Wc

func Wc(in io.Reader) (WcResult, error)

Wc counts newline, word, char and byte counts for an input, as well as the maximum line length.

Directories

Path Synopsis
cmd
cat
tee
wc
yes

Jump to

Keyboard shortcuts

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