1

This problem is related to the thread.

The line in my .zshrc

export LESS_TERMCAP_mb=$'\E[01;31m'     # begin blinking

The following seems to mean

  • \$ starts the expression
  • ' -- ' says everything in the brackets matters
  • \E apparently says that apply the following command
  • [01 seems to refer to the beginning of a file
  • ; seems to indicate between the beginning of the previous to
  • 31m which seems to be the end of a file

The statement is still confusing. Some pattern must match "a begin" and "blinking".

How do you read the line?

1 Answers1

5

This is an ANSI color sequence.

  • The $'...' means interpret backslash-escaped characters (like \e or \n) (see the "Quoting" section of the bash man page)
  • \E is the escape character (ASCII 27 decimal)
  • [ is just a square bracket
  • so Esc-[ begins the color sequence
  • 01 is "bright"
  • ; delimits colors
  • 31 is "red"
  • m is the end of the color sequence

The sequence Esc-[ 0 m resets to default colors.

Try

 echo $'\E[01;31m'Hello$'\E[0m' Masi

See this Wikipedia article for more information.

Dennis Williamson
  • 60,515
  • 14
  • 113
  • 148