我想在回声句子中间为一个单词着色,但似乎无法实现这一点。
这有效:
#!/bin/bash
wipe="\033[1m\033[0m"
yellow='\E[1;33'
echo -e "$yellow"
echo Hello World
echo -e "$wipe"
但这不会:
#!/bin/bash
wipe="\033[1m\033[0m"
yellow='\E[1;33'
black="40m"
echo -e "Output a $yellow coloured $wipe word."
# or
echo -e "Output a ${yellow} coloured ${wipe} word."
我愚蠢地做错了什么?:)