Commands

The complete yup toolbox, grouped by what each command does in a pipeline.

Every command is a type-safe Go function composed through gloo-foo's typed-stream pipeline. playground commands also run live in the browser playground.

Sources

Generate a stream — the first stage of a pipeline.

commanddoesexample
echoemit arguments as a lineyup> echo hello worldplayground
emitemit literal textyup> emit done
yesrepeat a line until interruptedyup> yes ok | head -3playground
seqgenerate a numeric sequenceyup> seq 1 10playground
lslist directory entriesyup> ls
findwalk a directory treeyup> find . -name '*.go'

Search & filter

Keep, drop, and compare lines.

commanddoesexample
grepfilter lines matching a patternyup> grep -i error server.logplayground
commcompare sorted streamsyup> comm a.txt b.txt
uniqdrop adjacent duplicate linesyup> sort data.txt | uniq -cplayground

Transform

Rewrite the bytes flowing through the pipe.

commanddoesexample
trtranslateyup> echo HELLO | tr A-Z a-zplayground
sedapply an s/// substitutionyup> echo hello | sed s/l/L/gplayground
cutselect fieldsyup> cut -d' ' -f1 access.logplayground
pastemerge linesyup> paste a.txt b.txt
splitsplit fields onto linesyup> echo a,b,c | split -d,
joinjoin lines on a common fieldyup> join a.txt b.txt
nlnumber linesyup> cat data.txt | nlplayground
catconcatenate (optional numbering)yup> cat access.logplayground
tacreverse line orderyup> seq 1 5 | tacplayground
headoutput the first linesyup> seq 1 100 | head -3playground
tailoutput the last linesyup> seq 1 100 | tail -3playground
revreverse each lineyup> echo yupsh | revplayground
base64base64 encode or decodeyup> echo yup | base64
hexdumphex dump of inputyup> echo yup | hexdump

Summarize & order

Count, sort, and reshape the whole stream.

commanddoesexample
wccount linesyup> wc -l *.goplayground
sortsort linesyup> sort -rn data.txtplayground
shufshuffle lines randomlyyup> seq 1 5 | shuf
diffcompare streams line by lineyup> diff a.txt b.txt
jsonpretty-print JSONyup> cat data.json | json

Paths

Operate on path strings.

commanddoesexample
basenamestrip directory and suffixyup> basename src/main.go .goplayground
dirnamestrip the last path componentyup> dirname src/main.goplayground

External escape hatches

Shell out to real subprocesses when you need them. Not available in the browser playground.

commanddoesexample
execrun an external programyup> echo hi | exec cat
gitrun gityup> git status
perlrun a perl one-lineryup> echo hello | perl -p 's/l/L/g'