回覆列表
  • 1 # 看吧看吧開吧

    shell指令碼沒有print,而是使用echo,同時支援定義不同顏色的輸出。

    以下程式碼可參考一下:

    function print_error()

    {

    echo -e -n "\e[1;31m"

    echo -e "$@"

    echo -e -n "\e[0m"

    }

    function print_warn()

    {

    echo -e -n "\e[1;35m"

    echo -e "$@"

    echo -e -n "\e[0m"

    }

    function print_info()

    {

    echo -e -n "\e[1;32m"

    echo -e "$@"

    echo -e -n "\e[0m"

    }

    function print_tip()

    {

    echo -e -n "\e[0;32m"

    echo -e "$@"

    echo -e -n "\e[0m"

    }

    function print()

    {

    echo -e "$@"

    }

  • 中秋節和大豐收的關聯?
  • 跟豐收有關的詞語?