FAQ

Is yupsh a drop-in replacement for bash?

No. It reuses familiar syntax — pipes, flags, globs, quoting — but the built-in commands are Go functions running in-process, not the real /bin/grep or /bin/sort. Use exec, git, or perl when you need an actual subprocess.

Why no subprocess for built-ins?

Every built-in is a gloo.Command[[]byte, []byte] from the gloo-foo framework. Composing them with | chains typed Go functions directly, with no fork/exec overhead and no text-parsing round trip between stages.

Does wc -l really work the same as the real wc?

The common flags do — wc -l, head -n 10 / head -10, grep -v, cut -d , -f 2 all translate to each command's typed option. Full flag coverage is documented per command in its own repository; the shell's job is only the Unix-style-flag-to-typed-option translation.

What happens if a glob doesn't match anything?

It's left literal, matching POSIX shell default behavior — ls *.foo with no .foo files runs ls with the literal argument *.foo.

Can I script yupsh non-interactively?

Yes — yupsh < script.txt reads from a file or a pipe. Piped input always uses the plain line-scanning path rather than the interactive terminal editor, so a script's behavior doesn't depend on whether a TTY happens to be attached.

Why isn't awk wired up?

awk's constructor takes a Program interface (Begin/Condition/Action/End) rather than a string, and there's no string-to-Program parser yet. while and capture are unwired for the same class of reason — they take a Go function or an io.Writer, not command-line text.

Where do I add a new command?

One entry in internal/command/registry.go — see Architecture for the shape and the test coverage expected of it.