在shell中获得非ASCII字符Linux
问题描述:
我有一个返回非ASCII编码的base64结果的命令,如何获得shell变量的结果。在shell中获得非ASCII字符Linux
任何解决方案来获取它?
实施例:
$ mycommand|base64 -d > f
# verify presence of character with hexdump command
$ hexdump -C f
00000000 06 05 03 01 |....|
00000004
答
我发现了解决方案:
$ a=`mycommand|base64 -d|hexdump -v -e '1/1 "%02X"'`
$ echo $a
06050301