Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetUserInfo ¶
func ShellSystem ¶ added in v1.1.0
执行命令并实时获取输出,和Python的os.system函数一样,返回退出代码 (excode int, out string, err error)
Types ¶
type ShellDebug ¶
type ShellDebug struct {
// contains filtered or unexported fields
}
定义命令的结构体
func ShellInit ¶
func ShellInit(debug, prints, ptinter bool, password string) *ShellDebug
命令实例构造函数, 当不需要执行sudo命令的时候直接传入任意字符串给password即可
func (*ShellDebug) GetStatusOutputBool ¶
func (shells *ShellDebug) GetStatusOutputBool(cmd string) (bool, string)
执行命令并获取输出数据, 返回执行结果布尔值 - (成功/失败)及 命令输出 (字符串)
func (*ShellDebug) Shell ¶
func (shells *ShellDebug) Shell(command string) bool
执行命令并获取执行结果, 返回执行结果(成功/失败)
func (*ShellDebug) ShellGetOutSudo ¶
func (shells *ShellDebug) ShellGetOutSudo(cmd string) (bool, string)
通过Sudo权限执行命令并获取输出数据, 返回执行结果(成功/失败)及命令输出(字符串)
func (*ShellDebug) ShellSudo ¶
func (shells *ShellDebug) ShellSudo(command string) bool
执行命令并获取执行结果, 返回执行结果(成功/失败)
Click to show internal directories.
Click to hide internal directories.