Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hexdump Europe/London tzfile(5) not advancing offset pointer across many line format file #2976

Open
BrianInglis opened this issue Apr 19, 2024 · 0 comments

Comments

@BrianInglis
Copy link

BrianInglis commented Apr 19, 2024

Running hexdump on tzfile(5) Europe/London from tzdata 2024a (data is in network big-endian order - so sticking to hex):

$ ls -lgo /usr/share/zoneinfo/Europe/London
-rw-r--r-- 6 3664 Mar 28 01:26 /usr/share/zoneinfo/Europe/London
$ hexdump -f tzfile.hd /usr/share/zoneinfo/Europe/London > tzfile-hd.log

format file:
tzfile.hd.txt
trying to produce better output than a series of xxd commands shown as a script at bottom with log output.
It appears the hexdump input offset does not advance over many lines of input formats, then it does and sticks again, and so on:
tzfile-hd.log

It appears that every format string in a file needs to be on a single line for hexdump to work properly:
$ hexdump -f tzfile-1line.hd /usr/share/zoneinfo/Europe/London > tzfile-1line-hd.log
tzfile-1line.hd.txt
tzfile-1line-hd.log

There appear to be no non-trivial hexdump format or format file examples in the man page or on the web!

xxd script and output log:

while read s l g
do 
    xxd -s 0x$s -l 0x$l -g $g	/usr/share/zoneinfo/Europe/London
done <<-EOF
	  0  2c 4
	 2c 3c8 4
	3f4  f2 1
	4e6  30 6 -c 12
	516  11 1
	527  10 1
	537  2c 4
	563 790 8
	cf3  f2 1
	de5  30 6 -c 12
	e15  11 1
	e26  10 1
	e36  1a 1
EOF

tzfile-xxd.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant