shell

package
v0.0.0-...-f4175bf Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunCommand

func RunCommand(command string) error

RunCommand runs the specified list of commands through the bash shell. This means you can simply write your commands like "echo "hello world" | sudo tee /bin/useless > /dev/null". If any errors are encountered while running the script, this function returns them. Note that because this will run whatever commands you provide to it, you should not run user-provided input through it without at least sanitizing it.

Types

type CommandFailed

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

Indicates that a command failed to run.

func (CommandFailed) Error

func (e CommandFailed) Error() string

type CommandNotFound

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

Indicates that a command was unable to be found on the machine's PATH.

func (CommandNotFound) Error

func (e CommandNotFound) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳