bash

package
v0.1.0-latest-stable Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(cmdStr string) (stdout, stderr bytes.Buffer, err error)

func RunScriptWithContext

func RunScriptWithContext(ctx context.Context, path string) (stdout, stderr bytes.Buffer, err error)

RunScriptWithContext executes path directly (honors the file's shebang or binary format), supporting both shell scripts and compiled executables.

func RunWithContext

func RunWithContext(ctx context.Context, cmdStr string, opts ...CmdOption) (stdout, stderr bytes.Buffer, err error)

func RunWithOptions

func RunWithOptions(cmdStr string, opts ...CmdOption) (stdout, stderr bytes.Buffer, err error)

Types

type CmdOption

type CmdOption func(*exec.Cmd)

type RunFunc

type RunFunc func(cmdStr string) (stdout, stderr bytes.Buffer, err error)

RunFunc runs a shell command and returns stdout, stderr, and any error.

type RunScriptWithContextFunc

type RunScriptWithContextFunc func(ctx context.Context, path string) (stdout, stderr bytes.Buffer, err error)

RunScriptWithContextFunc runs an executable directly (without a shell wrapper) and returns stdout, stderr, and any error.

type RunWithContextFunc

type RunWithContextFunc func(ctx context.Context, cmdStr string, opts ...CmdOption) (stdout, stderr bytes.Buffer, err error)

RunWithContextFunc runs a shell command with a context and returns stdout, stderr, and any error.

Jump to

Keyboard shortcuts

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