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

  • 相关阅读:
    结构体排序中sort的自定义函数cmp()
    c++中清空输入缓冲区的方法(做cf的时候炸了)
    求第k小的数
    数论—约数
    HDU递归求解专题练习
    62、rdp报表
    61、inputTree
    60、list集合的各种姿势的排序
    59、table移动高亮
    13、docker安装nginx
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13349452.html
Copyright © 2011-2022 走看看