1

I am trying to display double > "»". I belive it is xBB in char set. How can I do it?

Thanks

1
  • Typing or displaying? – A.B. Sep 4 '15 at 4:53
2

The » character is the Unicode character U+00BB;

You may print it using its Unicode code point (in bash 4.2+) or its UTF-8 hexadecimal representation using echo:

user@debian ~ % echo -e '\u00BB' 
»
user@debian ~ % echo -e '\xC2\xBB'
»

Or using printf:

user@debian ~ % printf '%b\n' '\u00BB'
»
user@debian ~ % printf '%b\n' '\xC2\xBB'
»
3
  • Thanks for answer. It works. Question: what the \u00 means and what different from \x00\xC2? Why it works on other term type by just using \xBB? – linux-lover Sep 4 '15 at 2:27
  • @linux-lover Actually my answer was rather unprecise, for various reasons; see the update. The \uNNNN sequence is directly interpreted as an Unicode code point (this works only in bash 4.2+), while I guess that the \xC2\xBB sequence is interpreted based on the shell's current encoding. Where did you type \xBB to get »?. Anyway I'd like to tell more about the second option, but in total honesty I just know that it works. Gonna do some research tomorrow tough, since I'm interested as well, and I'll update this answer as well. – kos Sep 4 '15 at 3:33
  • Sorry, did not response immediately. Your suggestions work on both method. I use \xBB to get >> on command prompt for many years from old version putty (NOT 2015-09-02.1e0e962) to linux (Oracle, Red hat and SuSe). Now, I have to use your suggestion. – linux-lover Sep 9 '15 at 15:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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