command line - How is the [OK] or [FAIL] column created? - Ask Ubuntu


i'd know how shell display last column (ok or fail) shown in image

enter image description here

(from question reboot server command line?.)

could me work out how done?

what ?

those fancy ok/fail messages see boot messages output tty1 during boot process. typically, while boot process ongoing can see messages instead of pretty boot logo pressing esc key. same thing can done during shutdown process. screen typically supposed cleared once boot process complete, doesn't happen ( variety of reasons, 1 of messages appear @ 1 speed or baud rate , tty1 set @ different baud rate)

to answer question, technically not shell, separate program, namely systemd init system puts out messages ( in pre-15.04 upstart init system ). if you're starting learn linux, don't worry systemd, topic know because systemd supposed start important services on system.

how can myself ?

technical aspects of writing these types of messages simple: can use "\r" control character , special escape sequences make output of color. these control characters can used in programming language, whether c or shell script. in fact, i've answered related question before, , have written simple script demonstrate how 1 can print status message. color, see linux documentation project's article colorizing scripts


Comments

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User