參考資料
參考FLOZz’ MISC的說明頁面
基本語法
1 | echo -? "you can see this" |
echo的後面可以加-e, -n , -p等
最常見的是使用-e因為加上-e後可以讓""內的顏色控制碼生效,換行碼生效等等效果
內文使用
可以使用
\n- 換行
\e- 跟字型有關的控制碼開頭
Formatting
Set
| Code | Description | Example | Preview |
|---|---|---|---|
| 1 | Bold/Bright | echo -e "Normal \e[1mBold" | Normal Bold |
| 2 | Dim | echo -e "Normal \e[2mDim" | Normal Dim |
| 4 | Underlined | echo -e "Normal \e[4mUnderlined" | Normal Underlined |
| 5 | Blink 1) | echo -e "Normal \e[5mBlink" | Normal Blink |
| 7 | Reverse (invert the foreground and background colors) | echo -e "Normal \e[7minverted" | Normal inverted |
| 8 | Hidden (useful for passwords) | echo -e "Normal \e[8mHidden" | Normal Hidden |














































