Bash: Heavy headings for CLI

Updated . Posted . Visible to the public.

To print a colored full-width bar on the bash, use this bash script expression:

echo -e '\033[37;44m\nHEADING\033[0m\nLorem ipsum ...'

In Ruby:

  puts "\033[37;44m\n #{text}\033[0m" # blue bar

Notes: -e turns on escape character interpretation for echo. See this card for details on bash formatting.

The line above will print:

Dominik Schöler
Last edit
License
Source code in this card is licensed under the MIT License.
Posted by Dominik Schöler to makandra dev (2014-03-08 20:25)