How do you echo a 4-digit Unicode character in Bash?

后端 未结 18 2022
醉梦人生
醉梦人生 2020-11-29 14:38

I\'d like to add the Unicode skull and crossbones to my shell prompt (specifically the \'SKULL AND CROSSBONES\' (U+2620)), but I can\'t figure out the magic incantation to m

18条回答
  •  一向
    一向 (楼主)
    2020-11-29 15:06

    I'm using this:

    $ echo -e '\u2620'
    ☠
    

    This is pretty easier than searching a hex representation... I'm using this in my shell scripts. That works on gnome-term and urxvt AFAIK.

提交回复
热议问题