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 file" displays incorrect Windows text file line termination #2817

Open
Scotsgeek opened this issue Feb 28, 2024 · 4 comments
Open

Comments

@Scotsgeek
Copy link

Debian Linux Testing (Trixie)
util-linux 2.39.3

"hexdump file", with no command line args, shows incorrect display of hex characters, spacing and byte order

$ hexdump data.txt
0000000 6554 7473 0a0d
0000006

"hexdump -C file", shows correct byte order and spacing

$ hexdump -C data.txt
00000000 54 65 73 74 0d 0a |Test..|
00000006

data.txt

@Selorax
Copy link

Selorax commented May 4, 2024

hexdump without options dumps the data as little-endian two byte integers, I guess. Are you sure it's a bug?

@Scotsgeek
Copy link
Author

Scotsgeek commented May 4, 2024 via email

@Scotsgeek
Copy link
Author

Scotsgeek commented May 4, 2024 via email

@Selorax
Copy link

Selorax commented May 7, 2024

Why would you think that, by default, I want to see the file in "little-endian two byte integers"?

Indeed, if I was designing this program, I would make hexdump -C like output the default. You can also make it an alias in your .profile or something. I just got used to add -C every time I type hexdump.

Actually besides hexdump there is also od and xxd in default GNU/Linux install which can also output hexdump. Perhaps you might prefer to use one of these.

Call it a "bug" or a major "design flaw", it should be corrected to display the bytes as they appear in the file, by default, unless one or more of the options are used.

I am not sure about that. Output and default options of many command line utilities is mandated by POSIX specification. Besides some people might depend on default output format of hexdump without extra options.

Please refer to aforementioned text if you are interested. Also, I am not a developer, I'm a user like you.

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

2 participants