zoukankan      html  css  js  c++  java
  • shell中的一些技巧和知识

    写了两天脚本,不懂什么就网上搜,感觉零零碎碎学了不少东西,先把代码贴上来,明天周末有空一条一条找知识点吧

    #!/bin/bash
    # by wuboxiao
    
    rm -rf checkConfig.diff checkConfig.same checkConfig.error checkConfig.result
    files=`find $1/src/main/resources/performance -name "*.properties"`
    for i in $files;do
        diff $i ${i/performance/stable} 1>>checkConfig.result 2>>checkConfig.result
        if [ $? -eq 0 ]; then
           echo $i,${i/performance/stable} 1>>checkConfig.same
        else
           diff $i ${i/performance/stable} -y 1>>checkConfig.result 2>>checkConfig.result
           if [ $? -eq 1 ];then  
              echo $i,${i/performance/stable} 1>>checkConfig.diff
              diff $i ${i/performance/stable} -y --suppress-common-lines 1>>checkConfig.diff
           elif [ $? -eq 2 ];then 
              echo "结果为2"
           else  diff $i ${i/performance/stable} -y 2>>checkConfig.error
           fi
           echo -e "
    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
        fi
    done
    echo -e "e[1;31m配置文件缺失检查结果:e[0m"
    if [ ! -f checkConfig.error ];then 
       echo "无配置文件缺失"
     else cat checkConfig.error
    fi
    echo -e "e[1;31m配置文件不同检查结果:e[0m"
    if [ ! -f checkConfig.diff ];then 
       echo "无不同的配置文件"
    else cat checkConfig.diff
    fi
     if [ $# -eq 2 ];then
       echo -e "e[1;31m配置文件相同检查结果:e[0m"
       if [ ! -f checkConfig.same ];then 
          echo "无相同的配置文件"
       else cat checkConfig.same
     fi
    fi
    

      

  • 相关阅读:
    CORS enabled image (Miscellaneous) – HTML 中文开发手册
    PHP fread() 函数
    iswcntrl (Strings) – C 中文开发手册
    HTML DOM createComment() 方法
    HTML draggable 事件属性
    HTML table border 属性
    dedecms开启多站点
    SVN中trunk,branches,tags用法详解
    docker:搭建lamp应用
    centos安装samba
  • 原文地址:https://www.cnblogs.com/boucher/p/5718943.html
Copyright © 2011-2022 走看看