类 ShellUtils
- java.lang.Object
-
- com.ts.lib.common.util.ShellUtils
-
public final class ShellUtils extends Object
执行Shell command 的工具类- 作者:
- Li Junchao
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static classShellUtils.CommandResultshell command执行的resultShellUtils.CommandResult.resultshell执行结果,0表示正常, 非0表示shell执行失败ShellUtils.CommandResult.successMsg执行result为0时的messageShellUtils.CommandResult.errorMsg执行result非0时的message
-
构造器概要
构造器 构造器 说明 ShellUtils()
-
-
-
方法详细资料
-
execShell
public static ShellUtils.CommandResult execShell(List<String> commands, boolean root)
执行 shell command- 参数:
commands- 注意和ProcessBuilder默认参数不同,每一个command必须为一句完成的命令root- 是否 root- 返回:
ShellUtils.CommandResult
-
-