Documentation
¶
Index ¶
- type UnixCmd
- func (sh UnixCmd) CombinedOut() (string, error)
- func (sh *UnixCmd) CustomShell(Shell_Name, Exec_Arg string)
- func (sh *UnixCmd) CustomStd(Stdin, Stdout, Stderr bool)
- func (sh UnixCmd) GetExec() *exec.Cmd
- func (sh UnixCmd) Out() (string, error)
- func (sh *UnixCmd) Run() error
- func (sh *UnixCmd) RunWithShell(set bool)
- func (sh UnixCmd) SetAndCombinedOut(command string) (string, error)
- func (sh UnixCmd) SetAndOut(command string) (string, error)
- func (sh UnixCmd) SetAndRun(command string) error
- func (sh UnixCmd) SetAndStart(command string) error
- func (sh *UnixCmd) SetInput(input string)
- func (sh *UnixCmd) SetPath(path string)
- func (sh UnixCmd) Start() error
- func (sh *UnixCmd) Stderr(set bool)
- func (sh *UnixCmd) Stdin(set bool)
- func (sh *UnixCmd) Stdout(set bool)
- func (sh *UnixCmd) UseBashShell(set bool)
- type UnixSudoCmd
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UnixCmd ¶
type UnixCmd struct {
// contains filtered or unexported fields
}
global struct
func (UnixCmd) CombinedOut ¶
It is the same as run, but returns one more string value (the output of the command)
func (*UnixCmd) CustomShell ¶
Set a custom shell to exec the command
func (UnixCmd) Out ¶
It is the same as run, but skips the Std setting and returns an error value and the output as a string, i.e. exec.Command(<command>).Output()
func (*UnixCmd) Run ¶
Executes normally the command with the parameters set, with the classic exec.Command(<command>).Run()
func (*UnixCmd) RunWithShell ¶
If the value is true use exec.Command([shell],[arg],input) instead of exec.Command(input[0],input[1:]...)
func (UnixCmd) SetAndCombinedOut ¶
It is the same as cmd := command.Cmd("<command>"); cmd.CombinedOut() but in a single argument, what it does is to put an internal input (the one provided) and execute it directly without affecting the main structure.
func (UnixCmd) SetAndOut ¶
It is the same as cmd := command.Cmd("<command>"); cmd.Out() but in a single argument, what it does is to put an internal input (the one provided) and execute it directly without affecting the main structure.
func (UnixCmd) SetAndRun ¶
It is the same as cmd := command.Cmd("<command>"); cmd.Run() but in a single argument, what it does is to put an internal input (the one provided) and execute it directly without affecting the main structure.
func (UnixCmd) SetAndStart ¶
It is the same as cmd := command.Cmd("<command>"); cmd.Start() but in a single argument, what it does is to put an internal input (the one provided) and execute it directly without affecting the main structure.
func (UnixCmd) Start ¶
Run the command in a new goroutine, just like cmd.Run(), but using exec.Command(<cmd>).Start()
func (*UnixCmd) UseBashShell ¶
type UnixSudoCmd ¶
type UnixSudoCmd struct {
UnixCmd
// contains filtered or unexported fields
}
func Sudo_Cmd ¶
func Sudo_Cmd(command string, optional_password ...string) UnixSudoCmd
Runs a command as sudo
func (UnixSudoCmd) CombinedOut ¶
func (sh UnixSudoCmd) CombinedOut() (string, error)
func (UnixSudoCmd) Out ¶
func (sh UnixSudoCmd) Out() (string, error)
func (UnixSudoCmd) Run ¶
func (sh UnixSudoCmd) Run() error
func (*UnixSudoCmd) SetSudoPasswd ¶
func (sh *UnixSudoCmd) SetSudoPasswd(password string)
Sudo parameters
func (UnixSudoCmd) Start ¶
func (sh UnixSudoCmd) Start() error