zshell

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2023 License: MIT Imports: 13 Imported by: 10

Documentation

Overview

Package zshell use a simple way to execute shell commands

Index

Constants

This section is empty.

Variables

View Source
var (
	Debug = false
	Env   []string
	Dir   string
)

Functions

func BgRun

func BgRun(command string) (err error)

func ExecCommand added in v0.1.29

func ExecCommand(ctx context.Context, command []string, stdIn io.Reader, stdOut io.Writer,
	stdErr io.Writer) (code int, outStr, errStr string, err error)

func ExecCommandHandle added in v0.1.64

func ExecCommandHandle(ctx context.Context, command []string,
	bef func(cmd *exec.Cmd), aft func(cmd *exec.Cmd, err error)) (code int,
	err error)

func OutRun

func OutRun(command string, stdIn io.Reader, stdOut io.Writer,
	stdErr io.Writer) (code int, outStr, errStr string, err error)

func PipeExecCommand added in v0.1.64

func PipeExecCommand(ctx context.Context, commands [][]string) (code int, outStr, errStr string, err error)

func Run

func Run(command string) (code int, outStr, errStr string, err error)

func RunContext added in v0.1.44

func RunContext(ctx context.Context, command string) (code int, outStr, errStr string, err error)

func RunNewProcess added in v0.0.21

func RunNewProcess(filemd5 string) (pid int, err error)

Types

type ShellBuffer added in v0.1.31

type ShellBuffer struct {
	// contains filtered or unexported fields
}

func (*ShellBuffer) String added in v0.1.31

func (s *ShellBuffer) String() string

func (*ShellBuffer) Write added in v0.1.31

func (s *ShellBuffer) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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