zoukankan      html  css  js  c++  java
  • rex 检查脚本执行的返回结果

    task "prepare01", "192.168.137.3", sub {
       file "/home/mqm/xbin/test.sh",
       source => "/root/Rex/test.sh",
       mode => 755,  
       owner  => "mqm",  
       group => "mqm";
       my $output = run "/home/mqm/xbin/test.sh";  
       print "--------------------------------
    ";
       say $?;
       print "--------------------------------
    ";
       say $output;  
    
    
    $VAR1 = {
              'auto_die' => undef
            };
    /home/mqm/xbin/test.sh: Command not found.error--------------------------------
    127
    --------------------------------
    
    127 失败
    
    
    正常情况:
    
    [root@node01 Rex]# rex prepare01
    [2017-10-22 22:55:38] WARN - Please use only the following characters for task names:
    [2017-10-22 22:55:38] WARN -   A-Z, a-z, 0-9 and _
    [2017-10-22 22:55:38] WARN - Also the task should start with A-Z or a-z
    [2017-10-22 22:55:38] WARN - You can disable this warning by setting feature flag: disable_taskname_warning
    [2017-10-22 22:55:38] INFO - Running task prepare01 on 192.168.137.3
    ddad2313
    $VAR1 = {
              'auto_die' => undef
            };
    --------------------------------
    0
    --------------------------------
    QMNAME(test)                                              STATUS(Ended immediately)
    [2017-10-22 22:55:40] INFO - All tasks successful on all hosts

  • 相关阅读:
    js 获取url参数
    new Date()日期在IOS的兼容问题
    js判断是否为微信浏览器
    ionic3 带数据返回上一页
    ionic3 打包android apk
    https打开有地图页面问题
    限制字符个数
    placeholder兼容ie
    Sequence Classification
    Part of Speech Tagging
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13349452.html
Copyright © 2011-2022 走看看