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.
| command | does | example | |
|---|---|---|---|
| echo | emit arguments as a line | yup> echo hello world | playground |
| emit | emit literal text | yup> emit done | |
| yes | repeat a line until interrupted | yup> yes ok | head -3 | playground |
| seq | generate a numeric sequence | yup> seq 1 10 | playground |
| ls | list directory entries | yup> ls | |
| find | walk a directory tree | yup> find . -name '*.go' |
Search & filter
Keep, drop, and compare lines.
| command | does | example | |
|---|---|---|---|
| grep | filter lines matching a pattern | yup> grep -i error server.log | playground |
| comm | compare sorted streams | yup> comm a.txt b.txt | |
| uniq | drop adjacent duplicate lines | yup> sort data.txt | uniq -c | playground |
Transform
Rewrite the bytes flowing through the pipe.
| command | does | example | |
|---|---|---|---|
| tr | translate | yup> echo HELLO | tr A-Z a-z | playground |
| sed | apply an s/// substitution | yup> echo hello | sed s/l/L/g | playground |
| cut | select fields | yup> cut -d' ' -f1 access.log | playground |
| paste | merge lines | yup> paste a.txt b.txt | |
| split | split fields onto lines | yup> echo a,b,c | split -d, | |
| join | join lines on a common field | yup> join a.txt b.txt | |
| nl | number lines | yup> cat data.txt | nl | playground |
| cat | concatenate (optional numbering) | yup> cat access.log | playground |
| tac | reverse line order | yup> seq 1 5 | tac | playground |
| head | output the first lines | yup> seq 1 100 | head -3 | playground |
| tail | output the last lines | yup> seq 1 100 | tail -3 | playground |
| rev | reverse each line | yup> echo yupsh | rev | playground |
| base64 | base64 encode or decode | yup> echo yup | base64 | |
| hexdump | hex dump of input | yup> echo yup | hexdump |
Summarize & order
Count, sort, and reshape the whole stream.
| command | does | example | |
|---|---|---|---|
| wc | count lines | yup> wc -l *.go | playground |
| sort | sort lines | yup> sort -rn data.txt | playground |
| shuf | shuffle lines randomly | yup> seq 1 5 | shuf | |
| diff | compare streams line by line | yup> diff a.txt b.txt | |
| json | pretty-print JSON | yup> cat data.json | json |
Paths
Operate on path strings.
| command | does | example | |
|---|---|---|---|
| basename | strip directory and suffix | yup> basename src/main.go .go | playground |
| dirname | strip the last path component | yup> dirname src/main.go | playground |
External escape hatches
Shell out to real subprocesses when you need them. Not available in the browser playground.
| command | does | example | |
|---|---|---|---|
| exec | run an external program | yup> echo hi | exec cat | |
| git | run git | yup> git status | |
| perl | run a perl one-liner | yup> echo hello | perl -p 's/l/L/g' |