bshell

package
v0.0.0-...-b3f7bda Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnv

func GetEnv(key string) string

func SearchBinary

func SearchBinary(file string) string

SearchBinary searches the binary `file` in current working folder and PATH environment.

func SearchBinaryPath

func SearchBinaryPath(file string) string

func ShellExec

func ShellExec(cmd string, environment ...[]string) (result string, err error)

ShellExec executes given command `cmd` synchronously and returns the command result.

Types

type Process

type Process struct {
	exec.Cmd
	PPid int
}

func NewProcess

func NewProcess(path string, args []string, environment ...[]string) *Process

NewProcess creates and returns a new Process.

func (*Process) Kill

func (p *Process) Kill() (err error)

func (*Process) Pid

func (p *Process) Pid() int

func (*Process) Run

func (p *Process) Run() error

func (*Process) Signal

func (p *Process) Signal(sig os.Signal) error

func (*Process) Start

func (p *Process) Start() (int, error)

Jump to

Keyboard shortcuts

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