shellscriptでエラーメッセージをいい感じに出す
# Colorize output only if stdout referers to terminal if [ -t 1 ]; then textred="\033[1;31m" textgreen="\033[1;32m" textyellow="\033[1;33m" textblue="\033[1;34m" textreset="\033[0m" fi error() { echo -e $textred$@$textreset > /dev/stderr; exit 1; } # 使用例 error fugafuga This post is licensed under CC BY 4.0 by the author.