小编Dan*_*Dan的帖子

Perl Pack Unpack on Shell Variable

Ultimately my goal is to convert a hexdump of data to the correct floating point value. I have set up my shell script to isolate the individual hex values I need to look at and arrange them in the correct order for a little Endian float conversion.

To simplify everything, I'll bypass the code I have managed to get working, and I'll start with:

rawHex=0x41000000
echo $(perl -e 'print unpack "f", pack "L", $ENV{rawHex}')
Run Code Online (Sandbox Code Playgroud)

When I execute this code, the …

bash shell perl unpack pack

2
推荐指数
1
解决办法
58
查看次数

标签 统计

bash ×1

pack ×1

perl ×1

shell ×1

unpack ×1