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

后端 未结 18 2062
醉梦人生
醉梦人生 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:07

    % echo -e '\u2620'     # \u takes four hexadecimal digits
    ☠
    % echo -e '\U0001f602' # \U takes eight hexadecimal digits
    

提交回复
热议问题