• 可以借鉴的脚本函数



    输出颜色

    Color_Text()
    {
    echo -e " e[0;$2m$1e[0m"
    }
    
    Echo_Red()
    {
    echo $(Color_Text "$1" "31")
    }
    
    Echo_Green()
    {
    echo $(Color_Text "$1" "32")
    }
    
    Echo_Yellow()
    {
    echo $(Color_Text "$1" "33")
    }
    Echo_Blue()
    {
    echo $(Color_Text "$1" "34")
    }

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    stty命令,调用

    Press_Install()
    {
    echo ""
    Echo_Green "Press any key to install...or Press Ctrl+c to cancel"
    OLDCONFIG=`stty -g`
    stty -icanon -echo min 1 time 0
    dd count=1 2>/dev/null
    stty ${OLDCONFIG}
    . include/version.sh
    Kill_PM
    }


    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    从网上下载资源

    Download_Mirror='http://soft.vpser.net'
    Autoconf_Ver='autoconf-2.13'
    Download_Files ${Download_Mirror}/lib/autoconf/${Autoconf_Ver}.tar.gz ${Autoconf_Ver}.tar.gz
    Download_Files()
    {
    local URL=$1
    local FileName=$2
    if [ -s "${FileName}" ]; then
    echo "${FileName} [found]"
    else
    echo "Notice: ${FileName} not found!!!download now..."
     
    
    #-c, --continue 接着下载没下载完的文件
    #--progress=TYPE 设定进程条标记
    wget -c --progress=bar:force ${URL}
    fi
    }


    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    解压缩并且进入目录

    Tar_Cd()
    {
    local FileName=$1
    local DirName=$2
    cd ${cur_dir}/src
    [[ -d "${DirName}" ]] && rm -rf ${DirName}
    echo "Uncompress ${FileName}..."
    tar zxf ${FileName}
    echo "cd ${DirName}..."
    cd ${DirName}
    }
  • 相关阅读:
    oracle问题之死锁 (一)
    linux下oracle调试小知识
    Oracle实例名,服务名等概念区别与联系
    oracle 数据库、实例、服务名、SID
    Linux下启动/关闭Oracle
    Oracle监听器
    Oracle数据库、实例、用户、表空间、表之间的关系
    在Centos7上安装Oracle
    理财入门书籍
    [C/C++] VS 2015 C++ 插件
  • 原文地址:https://www.cnblogs.com/losbyday/p/5860760.html
Copyright © 2020-2023  润新知