现在的位置: 首页 > 综合 > 正文

将16进制string转成16进制stream

2013年03月03日 ⁄ 综合 ⁄ 共 166字 ⁄ 字号 评论关闭

script  sstream.sh:

#!/bin/bash
for num in $(echo "9e 8b 5a")
do
    echo $((16#$num)) | awk '{printf("%c", $0);}'
done

Invoke the script:

$bash sstream.sh | hexdump -C
00000000  9e 8b 5a                                          |..Z|
00000003

抱歉!评论已关闭.