如何在Shell脚本中使文本闪烁 [英] How to make a text blink in shell script
本文介绍了如何在Shell脚本中使文本闪烁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我下面有这段代码:
echo"\ 033 [33m程序的标题\ 033 [0m"
将颜色更改为黄色.
如何使程序标题"文本闪烁?
How can I make the text "Title of the Program" blink?
推荐答案
尝试添加 -e
(如果没有它就无法工作)
您可能需要在 echo
中添加 -e
选项(至少在我使用的所有或大多数系统上都是必需的).下面将告诉您的系统闪烁文本:
Try adding -e
if it's not working without it
You may need to add the -e
option to echo
(at least that's required on all or most systems I use). The following will tell your system to blink the text:
echo -e "\033[5mTitle of the Program\033[0m"
您可能会闪烁和颜色
您不必选择 黄色或闪烁.你也可以吃蛋糕:
You can have blinking and color
And you don't have to choose either yellow or blinking. You can have your cake and eat it too:
echo -e "\033[33;5mTitle of the Program\033[0m"
某些系统会忽略闪烁代码
您的系统可能会忽略闪烁代码-这似乎很常见.如果要使文本突出显示,但忽略了闪烁,则可以使用 7
:
echo -e "\033[33;7mTitle of the Program\033[0m"
或者您可以使用闪烁的和颜色(和黄色)反转:
Or you can use blinking and inversion of colors (and yellow):
echo -e "\033[33;5;7mTitle of the Program\033[0m"
这篇关于如何在Shell脚本中使文本闪烁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文