6 ms·
A bit tangential, here's a few unix utils you can use to inspect text: `vis`: display non-printable characters in a visual format `cat -e`: Display non-printi
by TheAceOfHearts 9y ago
A bit tangential, here's a few unix utils you can use to inspect text:
`vis`: display non-printable characters in a visual format
`cat -e`: Display non-printing characters and display a dollar sign (`$') at the end of each line.
`hexdump -c`: Display the input offset in hexadecimal, followed by sixteen space-separated, three column, space-filled, characters of input data per line.
`od -a`: Output named characters.
- pavelbr 9y agoIs `hexdump` not `xxd`?
- lainga 9y ago`hexdump` is part of util-linux, `xxd` is not. They do the same thing though, up to formatting differences.
- dotancohen 9y agoAnd on Debian it's called `hd`.
- gkya 9y agoxxd is part of vim IIRC.
- cyphar 9y ago> `vis`: display non-printable characters in a visual format Or `cat -v`, the namesake of http://cat-v.org/ http://cat-v.org/. :P
- logicallee 9y agowhat is cat-v.org? (Obviously I visited that link, read the about page - I'm asking for your summary. it's still not clear to me after my initial visit.)
- scbrg 9y agoI'm sure there are better people to answer this question, but cat-v.org is the personal blog & collection of interesting stuff by former plan9 personality uriel (sadly no longer with us). It hosts random thoughts and lots of interesting stuff (including man pages) about plan9 and early unix systems, and miscellaneous other unix trivia. It really is a treasure. Take the time to browse, it's well worth it if you're somewhat interested in unix history and not overly familiar with the subject already.
- logicallee 9y agoThank you, I found your summary helpful and yes I will look through it.
- gkya 9y agoNostalgic Unix nerds hating on everything that (i) was not in original Unix, or (ii) in Plan9, or (iii) not implemented by authors of these.
- Volt 9y agoCynical and disingenuous.
- B1FF_PSUVM 9y agoBitterly invidious Lisp nerd? (They give off rays or something ... took a cursory look to see if I was being unfair, and booom - https://www.gkayaalp.com/blog/20170206_emacs-argument.html https://www.gkayaalp.com/blog/20170206_emacs-argument.html )
- agumonkey 9y agoand under emacs whitespace-mode (just in case)
- LVB 9y agoFurther tangent: a colleague and I talked about creating a derivative of one of the programmer fonts, replacing smart/curly quotes and another such nuisances with unmistakeable indicators.
- sharpercoder 9y agoThis would be a useful feature for any programming font. I can totally imagine writing exploits through zero-width characters; smart insertion into interpreted strings (scanners/parsers) can potentially insert a security leak by an attacker. Though input can come from many places off course, this would at least make one vector visible.
- peteretep 9y agoYou could probably just invert any non-ASCII character, and you could probably do this programmatically over an existing font.
- wpietri 9y agoOoh! I adore `od`, and know too many options for it. But I didn't know about the others. Thanks! I'll also add my favorite companion to `od` and hexdumps: `man ascii`. P.S. May we please have a basic Markdown parser for HN?
- Flimm 9y agoDo you have any useful commands like these that can handle multi-byte characters in UTF-8? For instance, handling the zero-width space U+200B, which in UTF-8 takes up more than one byte. I've got some custom scripts that do, I was wondering if there was already something out there.