Help us shape the future of Go! Take the 2026 Go Developer Survey

read

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package read implements the `read` shell built-in.

Reads one line from c.Stdin and assigns it to the named variable(s) in c.Env. mvdan/sh ships its own `read` that mutates runner vars directly; our registration is reachable via /bin/read and the assignment is to c.Env (not propagated to the runner).

Supported flags: -r (raw), -p PROMPT (printed to c.Stderr), -n N / -N N (read at most N bytes), -d DELIM (use DELIM instead of \n), -s (silent, no echo — we have no terminal so this is a no-op), -a ARRAY (split into env vars ARRAY_0, ARRAY_1, ...), -t TIMEOUT (best-effort using ctx).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() command.Command

New returns the read command.

Types

This section is empty.

Jump to

Keyboard shortcuts

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