Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
I need to solve this problem first to solve the other problem here: serverfault.com/questions/35169/… –  Masi Jul 2 '09 at 17:50
1  
See also Documentation on LESS_TERMCAP_* variables? –  Gilles Jan 11 at 4:12

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer
    
Thank you for your answer! –  Masi Jul 2 '09 at 21:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.