Post AVvCLchLOWOrEOp7hI by joosteto@mamot.fr
 (DIR) More posts by joosteto@mamot.fr
 (DIR) Post #AVv9gDhnDEPvw7AB96 by simon@fedi.simonwillison.net
       2023-05-22T18:03:08Z
       
       0 likes, 0 repeats
       
       A quick TIL about the difference between "hexdump" and "hexdump -C"https://til.simonwillison.net/misc/hexdump
       
 (DIR) Post #AVvBpCzbQohMExuK6C by timbray@cosocial.ca
       2023-05-22T18:26:51Z
       
       0 likes, 0 repeats
       
       @simon That's a public service. Old Mac-heads like me have a brain function that automagically, when want to I type ”hexdump”, emits “hexdump -C” without noticeably involving any cognitive processes.
       
 (DIR) Post #AVvCLchLOWOrEOp7hI by joosteto@mamot.fr
       2023-05-22T18:32:54Z
       
       0 likes, 0 repeats
       
       @simon The man page mentions that -C is implied when hexdump is invoked as 'hd'.$ printf "abc\0" | hd00000000  61 62 63 00         |abc.|00000004
       
 (DIR) Post #AVvDSNqz5I6xAn7W4m by simon@fedi.simonwillison.net
       2023-05-22T18:45:32Z
       
       0 likes, 0 repeats
       
       @joosteto What OS is that? macOS doesn't seem to have "hd" by default
       
 (DIR) Post #AVvDoViaWac5w3kBTE by joosteto@mamot.fr
       2023-05-22T18:49:11Z
       
       0 likes, 0 repeats
       
       @simon I'm using ubuntu.Does it work if you simply create a symlink like this?$ ln -s /usr/bin/hexdump hd$ echo 'abc' | ./hd(just tried it, it does work here)
       
 (DIR) Post #AVvFiVZKMoFFdvg5ke by llimllib@hachyderm.io
       2023-05-22T19:10:44Z
       
       0 likes, 0 repeats
       
       @simon echo without `-e` will not produce a zero byte; your code sample should be `echo -ne 'abc\0'`
       
 (DIR) Post #AVvGbfSVIWtIF8mvvk by llimllib@hachyderm.io
       2023-05-22T19:12:44Z
       
       0 likes, 0 repeats
       
       @simon (one of the many reasons to prefer `printf` to `echo`!)
       
 (DIR) Post #AVvGbg4n0BW29shVbc by simon@fedi.simonwillison.net
       2023-05-22T19:20:37Z
       
       0 likes, 0 repeats
       
       @llimllib Thanks! Added that as a note: https://til.simonwillison.net/misc/hexdump#user-content-null-bytes-in-bash
       
 (DIR) Post #AVvGzpkMhNGP6KfLkG by llimllib@hachyderm.io
       2023-05-22T19:23:38Z
       
       0 likes, 0 repeats
       
       @simon ah, didn't realize it was a bashism! thanks
       
 (DIR) Post #AVvLIelm8Sx8NHYZBg by h_d@functional.cafe
       2023-05-22T20:13:06Z
       
       0 likes, 0 repeats
       
       @simon MacOs doesn't have the od command?That's the one I know to dump binary data in whatever format desired.https://www.man7.org/linux/man-pages/man1/od.1.html