shell

package
v0.0.0-...-d8a4e70 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exec

func Exec(shell string) (string, error)

Exec 执行 shell 命令

func Execf

func Execf(shell string, args ...any) (string, error)

Execf 安全执行 shell 命令

func ExecfAsync

func ExecfAsync(shell string, args ...any) error

ExecfAsync 异步执行 shell 命令

func ExecfWithDir

func ExecfWithDir(dir, shell string, args ...any) (string, error)

ExecfWithDir 在指定目录下执行 shell 命令

func ExecfWithOutput

func ExecfWithOutput(shell string, args ...any) error

ExecfWithOutput 执行 shell 命令并输出到终端

func ExecfWithPipe

func ExecfWithPipe(ctx context.Context, shell string, args ...any) (out io.ReadCloser, err error)

ExecfWithPipe 执行 shell 命令并返回管道

func ExecfWithTTY

func ExecfWithTTY(shell string, args ...any) (string, error)

ExecfWithTTY 在伪终端下执行 shell 命令

func ExecfWithTimeout

func ExecfWithTimeout(timeout time.Duration, shell string, args ...any) (string, error)

ExecfWithTimeout 执行 shell 命令并设置超时时间

Types

This section is empty.

Jump to

Keyboard shortcuts

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