Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 bash 中,您可以使用(例如)对输出进行着色
echo -e "\e[34mblue text\e[0m"
但这不适用于破折号。
有没有办法用破折号获得彩色输出?
使用 dash、bash、ksh、fish 和 zsh:
printf '%b' "\033[34;1mblue text\033[0m\n"