2015-11-04 73 views
0

我有一個返回非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 

回答

0

我發現瞭解決方案:

$ a=`mycommand|base64 -d|hexdump -v -e '1/1 "%02X"'` 
$ echo $a 
06050301