77
25
Homebrew has a neat trick of printing out little icons next to its output. Like this:
If I copy paste the icon it on its own and hit enter I get the result:
-bash: $'?\237\215?': command not found
And if I try it with echo
or printf
I just get ????
. Same if I escape all the quotes and $
s etc.
editron:~ stib$ echo $'?\237\215?'
????
So how do they do that? What do the magic characters $'?\237\215?'
mean?
1Also from just about anywhere in OS X you can summon the Emoji keyboard using the shortcut
Ctrl + Cmd + Space
. Doesn't work everywhere but works in most places – dominicbri7 – 2016-07-29T09:20:27.90718Awesome. So in the shell I can just do echo -e "\xF0\x9f\x8d\xba" – stib – 2013-01-18T13:28:25.390
4Also, try looking it up in the OS X dictionary (right click > look up) ;) – ihatetoregister – 2013-02-13T01:13:37.233
4Or with octal:
echo $'\360\237\215\272'
– Chad Skeeters – 2013-07-03T21:46:02.420