1

I was generating random characters for some purpose. By mistake I try the following in a terminal and got some surprising result. I am using bash shell provided by Ubuntu.

$ echo {Z..a}
Z [  ] ^ _ ` a

Inspiring by this result, I did

$ echo {z..A}
z y x w v u t s r q p o n m l k j i h g f e d c b a ` _ ^ ]  [ Z Y X W V U T S R Q P O N M L K J I H G F E D C B A

My question is what are these five characters [ ] ^ _ ` doing in the range. Do they have any special meaning or I am just performing some forbidden action.

People usually use $ echo {{A..Z},{a..z}} in order to get both lower as well as the upper case characters,

3

Take a look at ascii table. After uppercase Z there are exactly those characters that you got, so there's no surprise - bash read ascii table from where you told it to, to where you told it to. \ does not show up, though, because it is usually used for escape sequences like \n - a newline

enter image description here

| improve this answer | |
  • You have aptly pointed it out. I missed that point. One little addition \ appeared as an extra space. Thanks +1. – souravc May 9 '15 at 5:27
  • If you want a quick look at the ASCII table, do man ascii. – muru Jun 23 '15 at 19:36

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.