public static void executeWithoutResult(String shellFile)
{
//脚本文件为NULL或空值
if (null == shellFile || shellFile.equals(""))
{
logger.warn("ShellCommand shellFile is null.");
return;
}
if (logger.isDebugEnabled())
{
logger.debug("bash " + shellFile);
}
try
{
Runtime.getRuntime().exec("bash " + shellFile);
}
catch (Exception e)
{
logger.error("Execute " + shellFile + " exception:", e);
}
}
ShellCommand_Java代码中执行shell脚本_Process的输入、输出、错误流都需要关闭(3)
最新推荐文章于 2021-02-21 08:56:09 发布