How can I underline and bold from a shell script?
Use the tput command. Like this:
# Bold is SO=Stand Out
tput outputs the right codes for your current terminal. So don't
save its output and use that somewhere else. It only takes a second
to run the four tputs anyhow.
You can use tput from other languages too. Read its output with popen().
If you want to get really fancy, in C/C++ check out ncurses.
dnf install ncurses-devel
The Blessings library looks nice for Python.