Source From Here
Question
I'm writing a Bash script that prints some text to the screen:
Can I format the text? I would like to make it bold.
How-To
The most compatible way of doing this is using tput to discover the right sequences to send to the terminal:
then you can use the variables $bold and $normal to format things:
gives
Question
I'm writing a Bash script that prints some text to the screen:
- echo "Some Text"
How-To
The most compatible way of doing this is using tput to discover the right sequences to send to the terminal:
- bold=$(tput bold)
- normal=$(tput sgr0)
- echo "this is ${bold}bold${normal} but this isn't"
沒有留言:
張貼留言