• 【笔记】【Informatica】Java组件调用ssh客户端远程执行linux系统上的shell脚本


    Process mypro=null;
    
    try{
        String cmdStr="C:\SSH\ssh2.exe azik@172.16.20.1 /home/azik/tmp/echo_date.sh";
        mypro=Runtime.getRuntime().exec(cmdStr);
        mypro.waitFor();
        Integer errno=mypro.exitValue();
        logInfo("The errorlevel is :"+errno);
        if (errno != 0)  {
            logError("Execute Cmd Fail.");
            failSession("Catch Exception!");
        }
        
    
    } catch(Exception e) {
        logError(e.toString());
        failSession("Catch Exception!");
    } finally {
        if(mypro != null){
            mypro.destroy();
        }
    }
    

      

  • 相关阅读:
    notebook笔记
    from __future__ import absolute_import
    GUI
    version_info
    函数参数
    None
    exec、eval
    os
    IGeometry接口
    IGeometry接口
  • 原文地址:https://www.cnblogs.com/AzikPhil/p/Informatica_Java_SSH.html
Copyright © 2020-2023  润新知