shell

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2026 License: MIT Imports: 7 Imported by: 0

README

mvdan.cc/sh/moreinterp

This package is not published under a release tag. To update it to the latest version, run:

go get mvdan.cc/sh/moreinterp/coreutils@master

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExitCodeFrom

func ExitCodeFrom(err error) int

ExitCodeFrom extracts the shell exit status from a shell execution error. It returns the exit code when err wraps an interp.ExitStatus, or 0 for any other error.

func Run

func Run(ctx context.Context, prog *Program, streams *Streams) error

Run parses and executes the shell program described by prog, writing output to the provided streams. It returns an [error] if the source cannot be parsed or if the program exits with a non-zero status.

Types

type Program

type Program struct {
	Name string
	Dir  string
	Src  string
}

Program holds the source and execution context for a shell program to be interpreted.

type Streams

type Streams struct {
	Stdout io.Writer
	Stderr io.Writer
}

Streams holds the output writers used during program execution.

Jump to

Keyboard shortcuts

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